#C5883. Perfect Number Finder

    ID: 49581 Type: Default 1000ms 256MiB

Perfect Number Finder

Perfect Number Finder

You are given an integer N. Your task is to find and output the smallest perfect number that is strictly greater than N. A perfect number is a positive integer which is equal to the sum of its proper divisors (excluding itself). In other words, a number \(n\) is perfect if

\(\sum_{d|n,\ d<n} d = n\)

If no such perfect number exists under the constraint described below, output "Not found".

Note: For this problem, if N is greater than or equal to \(10^{18}\), you should output "Not found" immediately.

inputFormat

The input is given via standard input (stdin). The first line contains a single integer T denoting the number of test cases. Each of the next T lines contains one integer N.

outputFormat

For each test case, output a single line on standard output (stdout) containing the smallest perfect number greater than N. If there is no such perfect number under the constraints, output "Not found".## sample

3
5
28
1000000000000000000
6

496 Not found

</p>