REALNO - Real Numbers

Find whether there exists a pair of real numbers whose sum is in range (1, 2) in an array consisting of real number in the range (0, 2). If there exists such a pair print "found" else print "not found". (Double quotes only for clarity)

Note: all intervals given above are open intervals.

Input

First line is the number of test cases t (t <= 6),

then for each case number of real numbers in the array is given (n)

then in the next line the real numbers are given.

Output

Print the required answer, i.e., "found" or "not found".

Constraints

1 <= n <= 3*10^5

Sample

Input:
2
3
0.7 0.5 1.2
5
1.2 1.3 1.22 0.999 1.5

Output:
found
not found

Added by:Aditya Gourav
Date:2013-10-06
Time limit:0.100s-1s
Source limit:500000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:ADA95 C C++ 4.3.2 CPP

hide comments
2016-08-10 17:12:39
The miniscule time difference scanf() makes from cin with sync(false) + tie(0) gives me AC. sigh time limits.

Reply: The problem is meant to be solved in O(n), and time limits are put in place to try to filter out O(n logn) or O(n^2) solutions

Last edit: 2017-01-07 18:54:55
2016-05-29 08:17:58 Piyush Kumar
The question is solvable, but the time limit is somewhat strict!
2015-08-20 21:01:20 Tej Bahadur Singh
got a new idea ..using scanf();tle gone...
2015-07-28 13:35:53 kejriwal
Ohh boy..this was sweet !!
2015-07-27 19:58:31 Bhuvnesh Jain
beautiful problem with a beautiful solution....
2014-10-29 12:07:31 Raghav Aggiwal
use scanf printf to avoid tle..
2014-07-10 16:42:32 sj
what must be the time complexity for this
please anyone help

Reply: O(n)

Last edit: 2017-01-07 18:53:32
2014-06-15 09:52:03 kelaseek
funniest sum ever
2014-04-02 16:40:15 Bharath Reddy
Easy one
2014-01-20 16:38:57 GOKU
getting wrong answer.....plz help
any special test case
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.