Subtask 1 (29%): 1 ≤ N ≤ 3000.
Subtask 2 (71%): No further restrictions.
Subtask 3 (0%): Sample Testcases.
You're not logged in! Click here to login