WAITTIME Editorial

PROBLEM LINK:

Contest Division 1
Contest Division 2
Contest Division 3
Contest Division 4

Setter: Lavish Gupta
Tester: Nishank Suresh, Utkarsh Gupta
Editorialist: Pratiyush Mishra

DIFFICULTY:

To be Calculated

PREREQUISITES:

None

PROBLEM:

Chef is eagerly waiting for a piece of information. His secret agent told him that this information would be revealed to him after K weeks.

X days have already passed and Chef is getting restless now. Find the number of remaining days Chef has to wait for, to get the information.

It is guaranteed that the information has not been revealed to the Chef yet.

EXPLANATION:

Since we are expected to get information in K weeks, this implies that we will get information in (7 \times K) days. Now since X days have already been passed, so the remaining days, we have to wait are:

(7 \times K) - X

TIME COMPLEXITY:

O(1), for each test case.

SOLUTION:

Editorialist’s Solution
Tester1’s Solution
Tester2’s Solution