fork download
  1. import java.io.*;
  2. import java.math.*;
  3. import java.util.*;
  4. class Main
  5. {
  6. public static void main(String[] args) throws IOException
  7. {
  8. BigInteger bg =new BigInteger(br.readLine());
  9.  
  10. if(bg.mod(BigInteger.valueOf(4)).equals(BigInteger.valueOf(0)))System.out.println(bg);
  11. else if(bg.mod(BigInteger.valueOf(4)).equals(BigInteger.valueOf(1)))System.out.println(1);
  12. else if(bg.mod(BigInteger.valueOf(4)).equals(BigInteger.valueOf(2)))System.out.println(bg.add(BigInteger.ONE));
  13. else System.out.println(0);
  14. }
  15. }
Success #stdin #stdout 0.05s 4386816KB
stdin
654648646848648648646848447
stdout
0