Under construction

Still being built. Things may change

Walk in the Park

Interview

Time limit4sMemory limit1024 MB

Summary
Given vases with water a_i and drain rates b_i, print the total water left at each integer time from 0 to t.
Level

Medium4 of 10

Topics
Sorting, Prefix sum, Implementation
Solved
No attempts yet

Statement

The last week was rainy. Mr. Bean stayed at home for days, and on this sunny day he went for a walk in the central park. Walking along an alley, he saw a bright sign that read "2015: Year of Light!" The sign lifted his mood, and full of inspiration he set off for his destination to do good deeds.

At the park he found a sculpture made of a set of vases of different sizes. The ii-th vase has size aia_i, so over the week it collected aia_i units of water. Mr. Bean decided there should be no water in the vases, and as an honest man he set out to fix the situation. He made one hole in each vase. The hole in the ii-th vase has diameter bib_i, so bib_i units of water flow out of it per second. The holes were all made at the same moment. Mr. Bean wants to know the total amount of water left in all vases at each moment after the holes were made. Help him answer all of his questions.

Input

The first line contains two integers nn and tt (1≤n≤1051 \le n \le 10^5, 1≤t≤1061 \le t \le 10^6), the number of vases and the time during which Mr. Bean is interested in the water in the vases.

Each of the next nn lines contains two integers aia_i and bib_i (0≤ai≤1090 \le a_i \le 10^9, 0≤bi≤1090 \le b_i \le 10^9), describing the ii-th vase.

Output

Print t+1t+1 integers. The first line contains the total amount of water at the initial moment. Each following line contains the total amount of water at the next moment.

Examples1

  1. Example 1

    Input
    6 6
    12 2
    10 3
    3 1
    5 4
    7 2
    9 1
    
    Expected output
    46
    33
    23
    14
    9
    6
    3