Kakita's blog

By Kakita, history, 15 hours ago, In English

In Problem E I got a wrong answer on this test:

Input

1

2

2137 333979

Output

2137

My answer is -1, and I couldn't understand why 2137 is a valid solution knowing that 2137 is prime and 331 * 1009 = 333979.

I appreciate it if someone could give me a good explanation for this test.

  • Vote: I like it
  • +3
  • Vote: I do not like it

»
15 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by Kakita (previous revision, new revision, compare).

»
15 hours ago, # |
  Vote: I like it +3 Vote: I do not like it

Where did you find this test?

  • »
    »
    15 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I did find it in test 3, and if you use their solution in the tutorial, you will get the same result.

»
14 hours ago, # |
  Vote: I like it +19 Vote: I do not like it

add 2137 and then step by +2 until it's 331x, then by +331.