fork(1) download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define fast_io ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
  4. #define int long long
  5. #define endl '\n'
  6.  
  7. void solve(){
  8. int n,m;
  9. cin>>n>>m;
  10. cout<<1<<" "<<1<<"\n";
  11. for(int j=2;j<=m;++j) cout<<1<<" "<<j<<"\n";
  12. for(int i=2;i<=n;++i) cout<<i<<" "<<m<<"\n";
  13.  
  14. }
  15.  
  16.  
  17. int32_t main(){
  18. fast_io;
  19. int t=1;
  20.  
  21. while(t--) solve();
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0s 5308KB
stdin
2 3
stdout
1 1
1 2
1 3
2 3