/******************************************************* * Copyright (C) 2015 Haotian Wu * * This file is the solution to the question: * https://www.hackerrank.com/challenges/service-lane * * Redistribution and use in source and binary forms are permitted. *******************************************************/ #include #include #include #include #include using namespace std; int w[100000]; int main() { // Straight forward. Find the minimum in range [i,j]. // Use segment tree if the input is larger. int n,t; scanf("%d %d",&n,&t); for (int i=0;i