All submissions for this problem are available.### Read problem statements in [Hindi](http://www.codechef.com/download/translated/LTIME75/hindi/EID2.pdf), [Bengali](http://www.codechef.com/download/translated/LTIME75/bengali/EID2.pdf), [Mandarin Chinese](http://www.codechef.com/download/translated/LTIME75/mandarin/EID2.pdf), [Russian](http://www.codechef.com/download/translated/LTIME75/russian/EID2.pdf), and [Vietnamese](http://www.codechef.com/download/translated/LTIME75/vietnamese/EID2.pdf) as well. Eidi gifts are a tradition in which children receive money from elder relatives during the Eid celebration. Chef has three children (numbered $1, 2, 3$) and he wants to give them Eidi gifts. The oldest child, Chefu, thinks that a distribution of money is fair only if an older child always receives more money than a younger child; if two children have the same age, they should receive the same amounts of money. For each valid $i$, the $i$-th child is $A_i$ years old and it received $C_i$ units of money. Determine whether this distribution of money is fair. ### Input - The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows. - The first and only line of each test case contains six space-separated integers $A_1$, $A_2$, $A_3$, $C_1$, $C_2$ and $C_3$. ### Output For each test case, print a single line containing the string `"FAIR"` if the distribution is fair or `"NOT FAIR"` otherwise. ### Constraints - $1 \le T \le 1,000$ - $1 \le A_1, A_2, A_3 \le 17$ - $1 \le C_1, C_2, C_3 \le 100$ ### Subtasks **Subtask #1 (100 points):** original constraints ### Example Input ``` 5 5 7 10 10 20 50 5 5 5 20 10 20 10 1 17 5 10 15 3 6 3 8 10 9 8 5 5 50 10 10 ``` ### Example Output ``` FAIR NOT FAIR NOT FAIR NOT FAIR FAIR ``` ### Explanation **Example case 2:** All children have same age which is 5, but second child got less money than the other children, so it's not fair. **Example case 3:** First child is older than second child but he got less money than him, so it's not fair. **Example case 4:** First and third children have same age, but didn't get same amount of money, so it's not fair.
|Tags||cakewalk, kingofnumbers, ltime75, taran_1407|
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, SQL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, R, COB, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.