Subtask 1 (20%): 1 ≤ N, M ≤ 300.
Subtask 2 (30%): 1 ≤ N, M ≤ 3000.
Subtask 3 (50%): 1 ≤ N, M ≤ 500000.
Subtask 4 (0%): Sample Testcase
You're not logged in! Click here to login