RANKLISTPAGE Editorial

PROBLEM LINK:

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

Setter: Utkarsh Gupta
Tester: Satyam, Tejas Pandey
Editorialist: Pratiyush Mishra

DIFFICULTY:

590

PREREQUISITES:

None

PROBLEM:

Chef participated in a contest and got a rank X.

Chef is trying to find his name in the ranklist but there are too many pages.

Each page consists of 25 participants. Chef wants to find the exact page number which contains his name.
Help Chef find the page number.

EXPLANATION:

Given, that Chef has secured a rank of X and each page contains 25 participants, therefore the page that contains the Chef’s rank would be the ceil of X divided by 25:

\lceil \frac{X}{25} \rceil

TIME COMPLEXITY:

O(1) for each test case.

SOLUTION:

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