Problem 28472 --树状数组

28472: 树状数组

Time Limit: 4 Sec  Memory Limit: 512 MB
Submit: 1  Solved: 1
[Submit][Status][Web Board][Creator:][下载FPS0元][添加到购物车][下载测试数据0元][9950kb]

Description

Input

Output

Sample Input

5 5
1 3 3
2 3 5
2 4 5
1 1 3
2 2 5

Sample Output

1
0
665496236

HINT

Source

[Submit][Status]