UVa 10852

From Algorithmist
Jump to: navigation, search

Contents

[edit] 10852 - Less Prime

[edit] Summary

Pretty straightforward. Do as the question asks.

[edit] Explanation

Bruteforce should be good enough. One shortcut to note is that n - (p * x) is maximized when p is 1.

[edit] Input

5
4399
614
8201
101
7048

[edit] Output

2203
311
4111
53
3527
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox