Login
Sign-Up
Problem
Contest
Category
Submissions
English
Problem
Contest
Category
Submissions
English
#291
Submit Code
Submissions
교차로
Time Limit: 2 Sec
Memory Limit: 1024 MiB
한국어
Example Input 1
Copy
2 10 A 10 B
Example Output 1
Copy
10 11
Example Input 2
Copy
6 0 A 0 C 1 A 1 B 1 C 1 D
Example Output 2
Copy
0 0 -1 -1 -1 -1
Example Input 3
Copy
6 0 A 0 B 0 C 2 D 2 C 4 B
Example Output 3
Copy
0 1 2 4 3 4
Language-Specific Restrictions