H. Not Just an NP-Hard Problem
time limit per test
1.5 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Example
Input
1
3
6 7 6
Output
1 3 3
2 4
3 5
45.000000