Click Here to go back to the homepage.

Das Blinkenlights Solution:


import java.util.ArrayList;
import java.util.Scanner;


public class A {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
//		int wall = 0;
//		int min = 1;
//		int n = Integer.parseInt(sc.nextLine());
//		String str = 'R' + sc.nextLine();
//		int[] arr = new int[str.length()];
//		for(int i = 0; i < str.length(); i++){
//			if(str.charAt(i) == 'R'){
//				arr[i] = min++;
//				wall = i;
//				
//			}
//			else{
//				for(int j = wall; j < i; j++){
//					arr[j] = arr[j]+1;
//				}
//				arr[i] = arr[wall]-1;
//			}
//		}
//		for(int i : arr){
//			System.out.println(i);
//		}
				int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		if(LCM2(a, b) <= c){
			System.out.println("yes");
		}
		else{
			System.out.println("no");
		}
	} 
	
	private static int gcd(int a, int b){
		while(b > 0){
			int temp = b;
			b = a % b;
			a = temp;
		}
		return a;
	}
	private static int LCM2(int a, int b){
		return a * (b / gcd(a, b));
	}
	
}