import java.util.Scanner;
/**
* Created by fantasy on 2016/8/2.
*/
public class Main {
public int solve(int n, int s, int L){
int countTime = n*s+n-1;
int notVal = 4;
int ret = -1;
for(int cdReal=2, songOfCD=1; cdReal< L; songOfCD++){
if(notVal==cdReal){
notVal += 3;
cdReal++;
continue;
}
if (countTime%cdReal==0 && songOfCD%13!=0)
{
ret = countTime/cdReal;
}
else{
cdReal++;
}
if(countTime%cdReal==0 && songOfCD%13!=0)
{
ret = countTime/cdReal;
}
else{
cdReal++;
}
}
return ret;
}
public static void main(String[] args){
Main main = new Main();
Scanner in = new Scanner(System.in);
while (in.hasNextInt()) {// 注意while处理多个case
int n = in.nextInt();
int s = in.nextInt();
int L = in.nextInt();
int count = main.solve(n, s, L);
if (count != -1)
System.out.println(count);
}
}
}
我分明处理的啊,怎么老是提示没有处理?求大神解答啊