PROBLEM LINK:
Practice
Contest: Division 1
Contest: Division 2
Contest: Division 3
Contest: Division 4
Author: raysh07
Tester: sushil2006
Editorialist: iceknight1093
DIFFICULTY:
Cakewalk
PREREQUISITES:
None
PROBLEM:
Independence Day is on the 15-th of August.
Today is the X-th of August. How many days remain till Independence Day?
If it has already passed, print -1 instead.
EXPLANATION:
If X \gt 15, Independence Day has passed, so output -1.
Otherwise, there are (15 - X) days remaining.
TIME COMPLEXITY:
\mathcal{O}(1) per testcase.
CODE:
Editorialist's code (PyPy3)
x = int(input())
if x > 15: print(-1)
else: print(15-x)