Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #define pb push_back
- typedef long long ll;
- const int N = 1e5+10;
- const int oo = 1e9;
- using namespace std;
- int n,m,c,s;
- vector<int> re;
- int q;
- int main(){
- #ifndef ONLINE_JUDGE
- freopen("in.txt","r",stdin);
- #endif
- cin >> n >> m >> c;
- for(int i=0;i<m;i++){
- scanf("%d",&s);
- re.pb(s);
- }
- sort(re.begin(),re.end());
- cin >> q;
- for(int i=0;i<q;i++){
- scanf("%d",&s);
- int lo = (lower_bound (re.begin(), re.end(), s)) - re.begin();
- cout << (s - lo)%c << " " <<(s - lo)/c << endl ;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement