Radioactive Rock Editorial

Problem Link
CodeChef: Practical coding for everyone

Author: akhilesh_manda

Editorialist : akhilesh_manda

Pre-requisites

  • if-else, basic programming concepts

Difficulty : Easy

Explanation

Let sum=0.
Find the minimum of a1,a2,a3 and add it to sum, next add b to sum, next add 2* (min(c1,c2,c3)) as it takes 2 units of time to cover 1 unit distance, then add d/2 as 2 units of distance take 1 unit of time

if x - sum > 0 we have to print Yes, else print No

Solution :

for _ in range(int(input())):

    x=int(input())
    a1,a2,a3,b,c1,c2,c3,d=map(int,input().split())
    s= min(a1,a2,a3)+b+2*(min(c1,c2,c3))+int(d/2)
    if(x-s>0):
        print("YES")
    else:
        print("NO")