CF1051G.Distinctification
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
The first line contains a single integer n ( 1≤n≤2⋅105 ) — the number of pairs in sequence P .
Next n lines contain the elements of P : i -th of the next n lines contains two integers ai and bi ( 1≤ai≤2⋅105 , 1≤bi≤n ). It is guaranteed that all values of bi are pairwise distinct.
输入格式
Print n integers — the i -th number should be equal to f(Pi) .
输出格式
无
输入输出样例
输入#1
5 1 1 3 3 5 5 4 2 2 4
输出#1
0 0 0 -5 -16
输入#2
4 2 4 2 3 2 2 1 1
输出#2
0 3 7 1