Source code for submission s475

Fl.java

  1. /**
  2.  *
  3.  * @author cteam92
  4.  */
  5. import java.util.Scanner;
  6.  
  7. public class Fl {
  8.  
  9. public static void main(String[] args) {
  10. Scanner sc = new Scanner(System.in);
  11. while (true) {
  12. int n, x;
  13. int countFrac = 0;
  14.  
  15. if (!sc.hasNext()) break;
  16.  
  17. String thisLine = sc.nextLine();
  18. n = Integer.parseInt(thisLine.substring(2));
  19.  
  20. for (int y = 2 * n; y > n; y--) {
  21. if ((n * y) % (y - n) == 0) {
  22. countFrac++;
  23. }
  24. }
  25. System.out.println(countFrac);
  26. }
  27. }
  28. }
  29.