This problem has been modified to allow subtask grading.
Subtask 1 (13%): 1 <= N <= 1000
Subtask 2 (27%): 1 <= N <= 20000
Subtask 3 (60%): No additional constraints
Subtask 4 (0%): Sample Testcases
You're not logged in! Click here to login