This page is still under construction.

Parts of this page are still being built. What you see may change.

Medical Checkup

Time limit2sMemory limit512 MB

Summary
Given n students in a fixed queue and their per-item service times, report the item each student is on or waiting for at time t+0.5.
Level

Hard8 of 10

Topics
Simulation, Math, Prefix sum, Implementation
Solved
No attempts yet

Problem

Every student at the university has to take a medical checkup. The checkup items are numbered 1, 2, 3, and so on, and there is no limit on the number of items.

The students stand in one long queue, waiting for the checkup to start. They are numbered 1, 2, 3, and so on from the front of the queue. A student has to take the items in increasing order of the item number, skipping none of them and reordering none of them. The order of the students does not change either.

Different items run in parallel, but one item handles only one student at a time. A student therefore waits in the queue of the next item until everyone ahead has finished that item.

Each student has an integer value called the health condition. A student whose health condition is hh needs hh minutes to finish each item. Assume that no time passes between two students on the same item, and none between two items of the same student.

Find, at a given moment, the item that each student is being checked on or is waiting for.

Input

The input is a single test case in the following format.

n t
h1
.
.
.
hn

nn and tt are integers. nn is the number of students (1≤n≤1051 \le n \le 10^5), and tt is the moment of interest (0≤t≤1090 \le t \le 10^9). For each ii, the integer hih_i is the health condition of student ii (1≤hi≤1091 \le h_i \le 10^9).

Output

Print nn lines, each holding a single integer. Line ii holds the number of the item that student ii is being checked on or is waiting for, at (t+0.5)(t + 0.5) minutes after the checkup starts. You may assume that every student still has items left to finish at that moment.

Examples2

  1. Example 1

    Input
    3 20
    5
    7
    3
    
    Expected output
    5
    3
    2
    
  2. Example 2

    Input
    5 1000000000
    5553
    2186
    3472
    2605
    1790
    
    Expected output
    180083
    180083
    180082
    180082
    180082