Guest User

Untitled

a guest
Dec 27th, 2018
63
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<iostream>
  2. #include<vector>
  3. #include<algorithm>
  4. #include<map>
  5. #include<queue>
  6. #include<utility>
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11. int t,d,q,u,v;
  12. cin>>t;
  13. while(t--)
  14. {
  15. cin>>d;
  16. int a[32]={0};
  17. int b[32]={0};
  18. while(d--)
  19. {
  20. cin>>u>>v;
  21. a[u]=v;
  22. }
  23. for(int i=1;i<32;i++)
  24. a[i]=a[i]+a[i-1];
  25. cin>>q;
  26. while(q--)
  27. {
  28. cin>>u>>v;
  29. if(a[u]>=v)
  30. cout<<"Go Camp\n";
  31. else
  32. cout<<"Go Sleep\n";
  33. }
  34. }
  35. return 0;
  36. }
RAW Paste Data