MFP: Most Fluctuated Player

아직 제출이 없습니다시간 제한2초메모리 제한1024 MB

문제

In this unstable world, people who are not afraid of instability will win. Thus it's natural to have a contest that values Most Fluctuated Player (MFP), a player whose rank is most fluctuated during the contest.

International Change Promotion Contest (ICPC) is one of such contests. In this contest, NN participants challenge QQ quizzes. This contest uses two types of tokens: points and coins. Points are for evaluation of quiz ability itself, but coins are for evaluation of fluctuation. So coins are more important because it directly affects final results.

Each participant initially has 00 points and 00 coins. A participant that answers the ii-th quiz gets p_ip\_i points. Note that p_ip\_i can be negative; it's fine because the focus of the contest is instability (coins), not points. Point ranking is calculated every time after each quiz finishes, and each participant gets coins based on fluctuation of their point rank: if a participant's point rank is changed from aa to bb the participant gets ab|a - b| coins, where x|x| means the absolute value of xx. The point rank of a participant is defined as 11 plus the number of participants who have points (properly) greater than the point of the participant. For example, initially, all the participants have rank 11 since all the participants have 00 points and thus none has points greater than others.

You, as an organizer of ICPC, have a record of a past contest. The record contains information about QQ quizzes: the ii-th quiz was answered by participant a_ia\_i and the point is p_ip\_i. But the record doesn't contain the final results: the coins each participant earned in the end. Your task is to write a program to compute the numbers of coins of all the participants after QQ quizzes from the record.

입력

The input consists of a single test case of the following format.

NN QQ

a_1a\_1 p_1p\_1

\vdots

a_Qa\_Q p_Qp\_Q

The first line contains two numbers NN and QQ, where NN is the number of participants (1N1051 \le N \le 10^5) and QQ is the number of quizzes (1Q1051 \le Q \le 10^5). The ii-th of the following QQ lines consists of two integers a_ia\_i and p_ip\_i, which represent that the ii-th quiz was answered by participant a_ia\_i (1a_iN1 \le a\_i \le N) and the points of the ii-th quiz is p_ip\_i (109p_i109-10^9 \le p\_i \le 10^9).

출력

Print NN lines, the jj-th of which is the number of coins the jj-th participant earned after all the QQ quizzes finish.