Fl.java
import java.util.HashSet;
import java.util.Scanner;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author kajanek6
*/
public class Fl {
public static void main
(String[] args
) { HashSet<Double> mnozina=new HashSet<Double>();
double n=0;
int counter=0;
double y=0;
Scanner input
= new Scanner
(System.
in); while (input.hasNextLine()) {
counter=0;
String temp
= input.
nextLine(); n
=Double.
parseDouble(temp.
substring(2)); for(double i=1;i<10000;i++)
{
if((i-n)>0){
double vysl = n*i/(i-n);
//System.out.println(Math.abs(vysl-Math.round(vysl)));
if(vysl
>0 && Math.
abs(vysl
-Math.
round(vysl
))<0.0001) {
if(!mnozina.contains(i)){
counter++;
mnozina.add(i);
mnozina.
add((double)Math.
round(vysl
)); }
}
}
}
System.
out.
printf("%d\n",counter
); }
}
public class pair{
public int prvy;
public int druhy;
public pair(int a,int b){
prvy=a;
druhy=b;
}
}
}