1 solutions

  • 0
    @ 2026-10-11 15:27:36

    #include <bits/stdc++.h> using namespace std; int n,x,y; int main(){ cin>>n>>x>>y; for(int i = 1;i<=n;i++){ cout<<"("<<x<<","<<i<<") "; }cout<<endl; for(int i = 1;i<=n;i++){ cout<<"("<<i<<","<<y<<") "; }cout<<endl; int zsx=x,zsy=y,ysx=x,ysy=y; while(zsx>1&&zsy>1){ zsx--; zsy--; } while(ysx<n&&ysy<n){ ysx++; ysy++; } while(zsx<=ysx&&zsy<=ysy){ cout<<"("<<zsx<<","<<zsy<<") "; zsx++; zsy++; }cout<<endl; int zxx=x,zxy=y,ysx1=x,ysy1=y; while(zxx<n&&zxy>1){ zxx++; zxy--; } while(ysx1>1&&ysy1<n){ ysx1--; ysy1++; } while(zxx>=ysx1&&zxy<=ysy1){ cout<<"("<<zxx<<","<<zxy<<") "; zxx--; zxy++; }cout<<endl; return 0; }

    • 1

    Information

    ID
    902
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    1
    Tags
    (None)
    # Submissions
    298
    Accepted
    63
    Uploaded By