#include using namespace std; #define all(x) (x).begin(), (x).end() template void check_min(T &a, const T &b){ a = (a < b) ? a : b; } template void check_max(T &a, const T &b){ a = (a > b) ? a : b; } typedef long long ll; typedef long double ld; const int N = 1e5 + 3; int n, v; array p[N]; ld ans[N]; int main(){ ios::sync_with_stdio(false); cin.tie(NULL); freopen("transfer.in", "r", stdin); freopen("transfer.out", "w", stdout); cin >> n >> v; for(int i = 0; i < n; ++i){ cin >> p[i][0] >> p[i][1]; p[i][2] = i; } sort(p, p + n); priority_queue, vector>, greater>> pq; ld t = 0; for(int i = 0; i < n; ++i){ if(i && p[i - 1][0] != p[i][0] && !pq.empty()){ ld curr_time = p[i - 1][0]; while(!pq.empty() && t + (ld)(p[i][0] - p[i - 1][0]) * ((ld)v / pq.size()) >= pq.top().first){ ld x = (pq.top().first - t) / ((ld) v / pq.size()); t = pq.top().first; ans[pq.top().second] = curr_time + x; curr_time += x; pq.pop(); } if(!pq.empty()) t += (p[i][0] - curr_time) * ((ld)v / pq.size()); } //cout << "push " << p[i][1] + t << " " << p[i][2] << endl; pq.push({p[i][1] + t, p[i][2]}); //cout << t << endl; } ld curr_time = p[n - 1][0]; while(!pq.empty()){ ld x = (pq.top().first - t) / ((ld) v / pq.size()); t = pq.top().first; ans[pq.top().second] = curr_time + x; curr_time += x; pq.pop(); } for(int i = 0; i < n; ++i){ cout << fixed << setprecision(12) << ans[i] << "\n"; } }