| AlgoChief Sprint Round 1 |
|---|
| Закончено |
You are a farmer and you want to create the biggest field possible to make your farm.
You are given certain side lengths, you need to find what is the largest square field and the largest rectangle field you can make using the side lengths.
Print $$$-1$$$ if making a particular field is not possible.
A Square field cannot be a Rectangular Field
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 500$$$) — the number of testcases
It is guaranteed that the sum of all $$$n$$$ across all test cases does not exceed $$$2*10^5$$$.
For each test, print two integers, the biggest square area and biggest rectangle area possible
3 8 1 1 1 1 2 2 2 2 8 1 1 2 2 2 2 3 3 8 1 2 3 4 5 5 5 5
4 2 4 6 25 -1
| Название |
|---|


