#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pii pair<int,int>
#define pb push_back
#define fi first
#define se second
#define dd(x) cout<<#x<<" is "<<x<<endl;
signed main(){
ios::sync_with_stdio(0); cin.tie(0);
int n,l; cin>>n>>l;
int x[n];
for(int i=0; i<n; i++) cin>>x[i];
sort(x,x+n);
int tot=0,sp=1;
tot += x[n-1]; sp++;
for(int i=n-1; i>0; i--){
tot+=(x[i]-x[i-1])*sp;
sp++;
}
tot += x[0]*sp;
tot += n;
//dd(tot)
int q; cin>>q;
while(q--){
int s,e,t; cin>>s>>e>>t;
if(t < tot) cout<<"No\n";
else cout<<"Yes\n";
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |