# UVa 10852

## Summary

Pretty straightforward. Do as the question asks.

## Explanation

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

```5
4399
614
8201
101
7048
```

```2203
311
4111
53
3527
```