Problem1795--树状数组

1795: 树状数组

[Creator : ]
Time Limit : 4.000 sec  Memory Limit : 512 MB

Description

Sample Input Copy

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

Sample Output Copy

1
0
665496236

HINT

Source/Category