-
Notifications
You must be signed in to change notification settings - Fork 0
/
puzzle hunt
25 lines (21 loc) · 835 Bytes
/
puzzle hunt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Problem
Chef and some of his friends are planning to participate in a puzzle hunt event.
The rules of the puzzle hunt state:
"This hunt is intended for teams of 6 to 8 people."
Chef's team has N people in total. Are they eligible to participate?
Input Format
The first and only line of input will contain a single integer N: the number of people present in Chef's team.
Output Format
Print the answer: Yes if Chef's team is eligible to participate, and No otherwise.
import java.util.*;
class Codechef {
public static void main(String[] args) throws java.lang.Exception {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
if (n>=6 && n<=8) {
System.out.println("Yes");
} else {
System.out.println("No");
}
}
}