takmicenje
The job of the committee for the state competition in informatics is not really easy. In the beginning, all of the competitors have the same number of points. Sometimes this number is 0 and other times it is some positive integer so everyone can have some points and a boost in self-confidence. Since there is a large amount of programmers in the competition, solutions are simultaneously tested on a few computers so that the competitors won't have to wait long to get the results. The main computer, the server, gathers information from the other computers about processed test data. When a computer in the network processes a problem from some competitor, it sends the information to the server. This information includes the competitor's ID and the amount of points they won. The server shows the results on a big LCD screen so the committee can enjoy the grading process. So, at any given moment the server knows how many points each competitor has. Your task is to simulate the server.
0 N X - a new competition begins and every competitor has X points at the beginning1 X Y - Y points are added to competitor X2 X - calculate the current number of points for competitor X3 - turn off the serverEvery command is given in one line of standard input. Command 0 starts the competition and this command can be given multiple times, marking the beginning of a competition every time. Command 3 is given exactly once in the input and it is given in the last line. The number of commands is not greater than 10000. Numbers X and Y are non-negative integers, X<=N, Y<==100.
0 20 10
1 10 20
1 10 20
2 10
2 20
0 15 0
1 5 50
2 10
2 5
3Output:
50
10
0
50Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.