시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB124450.000%

문제

Last month, Dexter created the best infinite loop ever. However, his sister DeeDee used his computer to check her Facebook page and meanwhile she managed to erase two numbers from Dexter’s program.

Here is the damaged program in Java. (Check the input file for the same code in other languages.)

public class R {  
 
  static boolean magic(int x) {  
    int foo = 0;  
    while (x > 1)  
      for (int y=2; ; ++y) {  
        if (y==x) return foo≤0;  
        if (magic(y) && x%y==0) { x/=y; ++foo; break; }  
      }  
    return true;  
  }  
 
  public static void main(String[] argv) {  
    int where = ??????;  
    int step = ??????;  
    int best = where;  
    while (step != 0) {  
      where += step;  
      if (where < best) { best=where; System.out.println("*"); }  
      if (!magic(where)) break;  
    }  
  }  
}

In both data sets your task is to replace the two “??????” strings by a pair of integers W and S. Note that these integers must be in a valid range for a signed 32-bit integer variable (e.g., int in Java). That is, your values must satisfy −231 ≤ W,S ≤ 231 − 1.

As the solution to the easy data set R1, submit any two integers W and S such that the program will run in an infinite loop if where is initialized to W and step to S.

As the solution to the hard data set R2, submit two integers W and S such that the program will run in an infinite loop if where is initialized to W and step to S. Additionally, out of all pairs (W,S) that satisfy the first condition, your values W and S must be such that the number of stars printed by the program is maximized. (Any such pair will be accepted.)

입력

For your convenience, the input file contains the program in multiple languages. All these programs are equivalent.

출력

Output a single line with two space-separated integers W and S.

서브태스크

번호배점제한
Easy1
Hard2

제출할 수 있는 언어

Text

채점 및 기타 정보

  • 예제는 채점하지 않는다.