لینکهای مفید برای شرکت در مسابقه:
در طول مسابقه، میتوانید سؤالات خود را از قسمت «سؤال بپرسید» مطرح کنید.
Mohsen and Mohammadreza are teammates. They are participating in Codeforces’es contest called Gym every week. Like always Mohammadreza was late, so Mohsen started calling him. Their cellphones are always in silent mode so they don’t understand if someone is calling them. Mohsen kept calling and finally gave up. They both always check their cellphones every 10 hours. When Mohammadreza checks his cellphone he sees lots of missed calls!!! so he starts calling back Mohsen. Mohsen misses them too, Then, Mohsen checks his cellphone and starts calling Mohammadreza and this continues for hours. They can’t reach each other and because of that they miss the contest. Mohsen got bored so he started to make a problem for Newbies Contest.
He wrote number of times they called each other on a paper. He wrote number of Mohsen’s miss calls as a positive number and number of Mohammadreza’s miss calls as a negative number. Mohsen was wondering what is the longest interval that multiply of numbers within it, is maximum among any other interval?
First line of input contains an integer indicating number of test cases. Each test case contains two lines. First line contains an integer indicating number of times they called each other. Second line contains a list of non-zero integers separated with spaces. It’s guaranteed there is at least one negative integer in every 10 consecutive integers. NOTE: It’s possible that only one of them calls other person.
For each test case print a line containing two integers and separated with a single space, indicating the interval , where answer of is maximum. If there is more than one solution, print the one with smaller and then longer interval.