CSES - HIIT Open 2019 - Results
Submission details
Task:Alien Invasion II
Sender:.*
Submission time:2019-05-25 15:52:00 +0300
Language:Java
Status:COMPILE ERROR

Compiler report

input/main.java:4: error: class Main is public, should be declared in a file named Main.java
public class Main {
       ^
1 error

Code

import java.math.BigInteger;
import java.util.Scanner;

public class Main {
	
	public static boolean lol(BigInteger bii) {
		for(int i=2; i<100; i++) {
			if(bii.mod(new BigInteger(Integer.toString(i))).equals(new BigInteger("0"))) {
				System.out.println(bii);
				System.out.println(i + " " + bii.divide(new BigInteger(Integer.toString(i))));
				return true;
			}
		}
		return false;
	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scan = new Scanner(System.in);
		String s = scan.nextLine();
		BigInteger bi = new BigInteger(s);
		bi.mod(new BigInteger("2"));
		for(int i=101; i<10000; i++) {
			if(lol(new BigInteger(Integer.toString(i)+s)))
				break;
		}
	}

}