https://codeforces.com/contest/357/problem/C
Input Format
Check Link
Output Format
Check Link
Constraints
Check Link
Example
Input
4 3 1 2 1 1 3 3 1 4 4
Output
3 1 4 0
https://codeforces.com/contest/357/problem/C
Check Link
Check Link
Check Link
4 3 1 2 1 1 3 3 1 4 4
3 1 4 0