Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- typedef long long ll;
- int main()
- {
- ll q,n,r,i,cnt,mx,c1,x;
- set<ll>s;
- cin>>q;
- while(q--){
- cnt=0;
- cin>>n>>r;
- for(i=0;i<n;i++)cin>>x,s.insert(x);
- cnt=1;
- for(auto j=s.end();j!=s.begin();j--){
- c1=cnt;
- while(c1--)*j-=r;
- if(*j>0)cnt++;
- else
- break;
- }
- }
- cout<<cnt<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement