A.java 647 B

1234567891011121314151617181920212223242526272829
  1. import java.util.Scanner;
  2. /**
  3. * Created by chshru on 2017/11/4.
  4. */
  5. public class A {
  6. public static void main(String[] args) {
  7. Scanner cin = new Scanner(System.in);
  8. while (cin.hasNext()) {
  9. int n = cin.nextInt();
  10. int t = n;
  11. while (n % 2 == 0)
  12. n /= 2;
  13. while (n % 3 == 0)
  14. n /= 3;
  15. while (n % 5 == 0)
  16. n /= 5;
  17. if (n == 1 && n != t)
  18. System.out.println("Accepted");
  19. else
  20. System.out.println("Wrong");
  21. }
  22. cin.close();
  23. }
  24. }