UVa 10852

From Algorithmist
Jump to navigation Jump to search

10852 - Less Prime[edit]

Summary[edit]

Pretty straightforward. Do as the question asks.

Explanation[edit]

Bruteforce should be good enough. One shortcut to note is that is maximized when p is 1.

Implementations[edit]

Input[edit]

5
4399
614
8201
101
7048

Output[edit]

2203
311
4111
53
3527