The anxious Geek Sundaram
All submissions for this problem are available.
Geek Sundaram is extremely anxious. He is in a hectic schedule. He has to study for his assessment the next day, watch FRIENDS tv show (in spite of watching every episode more than 5 times.. :P ), prepare questions for the programming contest and also complete his projects. So his friends try to calm him down by advising whether he can complete all his tasks in the given time period.
Given the time taken (in seconds) to study S, to watch TV W, to prepare questions Q and do project P and the total time available until the deadline T, print "YES" if Geek can complete all the tasks within the deadline, otherwise print "NO". (quotes for clarity)
P.S. Geek doesn't have the power to multi task
- The first line of the input contains an integer t denoting the number of test cases. The description of t test cases follows."
- The first and the only line of each test case contains five integers S, W, Q, P, T as described in the problem.
- 1 ≤ t ≤ 10 6
- 1 ≤ S, W, Q, P, T ≤ 10 18
Input: 2 10 20 30 40 500 1 2 3 4 5 Output: YES NO
|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, 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, SCM chicken, CLOJ, FS|
Fetching successful submissions