Video Clips
시간 제한: 2000ms메모리 제한: 1024MB출처: Programmeringsolympiaden 2016 — katt2BOJ 21348
문제
On a popular web site, the KATT contestants can spend time watching video clips in between solving problems.
On the site, there are funny videos of cats jumping around on the keyboard, numbered between and . When one of the videos has been viewed, a suggestion for the next funny cat video is shown, which you of course click on and start watching.
For each contestant, you will be given the initial cat video he or she views. Determine what the :th video that each contestant watches will be.
입력
The sample judge reads input in the following format:
- line :
K M - line :
S[0] ... S[K - 1] - line :
N: the number of calls made toclip(I). - line
I1 ... IN: the parameters of the calls toclip(I).
출력
The sample judge will write lines with the return values of clip(I).
예제
예제 1
입력
4 2 3 2 1 0 2 3 1
출력
0 2
코드를 제출하려면 로그인하세요.