CodeChef SnackDown ONLINE QUALIFIERS 2021

 Home » Compete » SnackDown 2021 - Online Qualifiers



Lucky Number Problem Code: LUCKYNUM

Chef buys a lottery ticket that has a 3 digit code associated with it. He thinks that digit 7 is his lucky digit and brings him good luck. Chef will win some amount in the lottery if at least one of the digits of the lottery ticket is 7.

Given three digits AB, and C of the lottery ticket, tell whether Chef wins something or not?

Input Format

  • First line will contain T, the number of test cases. Then the test cases follow.
  • Each test case contains a single line of input, three space separated integers A,B,C.

Output Format

For each testcase, output in a single line answer "YES" if Chef wins a positive amount with the lottery and "NO" if not.

You may print each character of the string in uppercase or lowercase (for example, the strings "yEs", "yes", "Yes" and "YES" will all be treated as identical).

Constraints

  • 1T1000
  • 0A,B,C9

Sample Input 1 

3
0 0 0
7 8 9
2 7 7

Sample Output 1 

NO
YES
YES

Explanation

Test Case 1: Since no digit is equal to 7, Chef fails to win any amount in the lottery.

Test Case 2: Since the first digit is equal to 7, Chef will win some amount in the lottery.

Test Case 3: Since the second and third digit is equal to 7, Chef will win some amount in the lottery.


Solution

for _ in range(int(input())):
    l = list(map(int,input().split()))
    if 7 in l :
        print("YES")
    else:
        print("NO")


Test Match Series Problem Code: TESTSERIES


        

5 match test series between India and England has just concluded.

Every match could have ended either as a win for India, a win for England, or a draw. You know the result of all the matches. Determine who won the series or if it ended in a draw.

A team is said to have won the series if it wins strictly more test matches than the other team.

Input Format

  • First-line will contain T, the number of test cases. Then the test cases follow.
  • Each test case contains a single line of input, five space-separated integers R1,R2,R3,R4,R5 denoting the results of all the five matches. Ri=0 denotes that the test match ends in a draw. Ri=1 denotes that the test match is won by India. Ri=2 denotes that the test match is won by England.

Output Format

For each test output "DRAW" if the series ends in a draw, "INDIA" if the series is won by India, and "ENGLAND" if the series is won by England.

You may print each character of the string in uppercase or lowercase (for example, the strings "dRaw", "draw", "Draw" and "DRAW" will all be treated as identical).

Constraints

  • 1T1000
  • 0Ri2

Sample Input 1 

3
0 1 2 1 0
0 1 2 1 2
2 2 2 2 1

Sample Output 1 

INDIA
DRAW
ENGLAND

Explanation

Test Case 1: India wins 2 matches while England won 1 match so India wins the series.

Test Case 2: Both teams win 2 matches so the series ends in a draw.

Test Case 3: England won 4 matches while India won 1 match so England wins the series.

Solution

for _ in range(int(input())):
    l = list(map(int, input().split()))
    if l.count(1)>l.count(2):
        print("INDIA")
    elif l.count(1)<l.count(2):
        print("ENGLAND")
    else:
        print("DRAW")