Algorithm


problem Liink :https://www.codechef.com/problems/LUDO 

Problem

Chef is playing Ludo. According to the rules of Ludo, a player can enter a new token into the play only when he rolls a 6 on the die.

In the current turn, Chef rolled the number  on the die. Determine if Chef can enter a new token into the play in the current turn or not.

Input Format

  • The first line contains a single integer  — the number of test cases. Then the test cases follow.
  • The first and only line of each test case contains one integer  — the number rolled by the Chef on the die.

Output Format

For each test case, output YES if the Chef can enter a new token in the game. Otherwise, output NO.

You may print each character of YES and NO in uppercase or lowercase (for example, yesyEsYes will be considered identical).

Code Examples

#1 Code Example with C Programming

Code - C Programming

#include <stdio.h>
int main(void) {
	int x,t;
	scanf("%d",&t);
	while(t--)
	{
	    scanf("%d",&x);
	    if(x==6) printf("YES\n");
	    else printf("NO\n");
	}
	return 0;
}
Copy The Code & Try With Live Editor

Input

x
+
cmd
3
1
6
3

Output

x
+
cmd
NO
YES
NO
Advertisements

Demonstration


CodeChef solution LUDO  - Chef Plays Ludo Codechef solution in C,C++

Previous
CodeChef solution FIT - Fitness Codechef solution in C,C++
Next
CodeChef solution PRACLIST - How many unattempted problems Codechef solution in C.C++