the little elephants and candies

whats wrong with this code in python 3.1.2…for the problem “the little elephants and candies”?

import sys

t=int(input())

for i in range(t):

n,c=map(int,sys.stdin.readline().split())
a=list(map(int,sys.stdin.readline().split()))
if c>=sum(a):
    print("yes")
else:
    print("no")

Hello,

Try using “Yes” and “No”, beginning with capital letters :slight_smile:

In such problems you need to carefully and strictly follow the I/O formatting.

Good luck,

Bruno

2 Likes