Chef Ali wants to cook many dishes, each of which can be cooked in a given time. So, he asked his assistant to cook those dishes which takes minimum time to cook among the remaining dishes. Chef Ali will cook those dishes which will take maximum time to cook among the remaining dishes. You will be given the time of cooking. Your task is to find out the number of dishes cooked by Chef Ali and his assistant.
First line contains T, the number of test cases.
For each test case there are three lines, First line contains an integer n, the number of dishes to be cooked.
Second line contains n integers ( d1,d2...di...dn )the cooking time of all the dishes.
Third line gives the cooking time(ct).
For each test case output a single line containing two numbers ( space separated ), the number of dishes cooked by Ali and number of dishes cooked by Ali's assistant.
Input: 2 4 5 6 2 1 3 6 2 3 4 5 6 7 13 Output: 0 2 2 3
|Time Limit:||0.1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, JAVA, PYTH, PYTH 3.6, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, HASK, SCALA, 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, PERL6, TEXT, CLOJ, FS|
Fetching successful submissions