CSES - HIIT Open 2019 - Results
Submission details
Task:Alien Invasion II
Sender:.*
Submission time:2019-05-25 15:52:24 +0300
Language:Java
Status:READY
Result:ACCEPTED
Test results
testverdicttime
#1ACCEPTED0.35 sdetails
#2ACCEPTED0.35 sdetails
#3ACCEPTED0.34 sdetails

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;
		}
	}

}

Test details

Test 1

Verdict: ACCEPTED

input
2368469234876449

correct output
22368469234876449
3 7456156411625483

user output
1012368469234876449
3 337456156411625483

Test 2

Verdict: ACCEPTED

input
292929292929292929292929292931

correct output
129292929292929292929292929293...

user output
101292929292929292929292929292...

Test 3

Verdict: ACCEPTED

input
292929292929292929292929292979

correct output
129292929292929292929292929297...

user output
101292929292929292929292929292...