PROBLEM LINK:
Practice
Contest: Division 1
Contest: Division 2
Contest: Division 3
Contest: Division 4
Author: notsoloud
Testers: iceknight1093, satyam_343
Editorialist: iceknight1093
DIFFICULTY:
390
PREREQUISITES:
None
PROBLEM:
Given the spice level of an item on Chef’s menu, decide whether it is MILD
, MEDIUM
, or HOT
.
EXPLANATION:
This is a standard application of if
conditions. Given X, simply check which one of the three conditions it satisfies:
- If X \lt 4, the answer is
MILD
- If 4 \leq X \lt 7, the answer is
MEDIUM
- If 7 \leq X, the answer is
HOT
TIME COMPLEXITY:
\mathcal{O}(1) per testcase.
CODE:
Code (Python)
for _ in range(int(input())):
x = int(input())
if x < 4: print('Mild')
elif x < 7: print('Medium')
else: print('Hot')