fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. // your code goes here
  13. Scanner sc = new Scanner(System.in);
  14. int n = Integer.parseInt(sc.nextLine());
  15. int m = (n % 2);
  16. int k = n/2;
  17. int d = (k-1)*15+m*15;
  18. int x = 45*n+d+k*5;
  19. int a = x%60;
  20. int b = 9 + x/60;
  21.  
  22. System.out.print(b);
  23. System.out.print(" ");
  24. System.out.print(a);
  25. }
  26. }
Success #stdin #stdout 0.06s 4386816KB
stdin
3
stdout
11 35