Advertisement
Diene

Untitled

Feb 28th, 2018
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main(){
  6.  
  7. int x,y,a,b;
  8.  
  9. scanf("%d %d %d %d", &x, &y, &a, &b);
  10.  
  11. vector<int>m,n;
  12.  
  13. for(int i=a; i<=x; i++){
  14.  
  15.     for(int j=b; j<=min(i-1,b); j++){
  16.  
  17.         m.push_back(i), n.push_back(j);
  18.  
  19.     }
  20.  
  21. }
  22.  
  23. printf("%d\n", (int)m.size());
  24.  
  25. for(int k=0; k<(int)m.size(); k++){
  26.  
  27.     printf("%d %d\n", m[k], n[k]);
  28.  
  29. }
  30.  
  31. return 0;
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement