2 solutions

  • 0
    @ 2026-10-21 18:53:12
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
        int h,w,x,cnt=0;
        cin>>h>>w>>x;
        for(int r=1;r<=w;r++)
        {
            for(int c=1;c<=w;c++)
            {
                if(sqrt(pow(r,2)+pow(c,2))<=x+r-c)
                {
                    cnt++;
                }
            }
        }
        cout<<cnt;
        return 0; 
    }
    

    Information

    ID
    3018
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    5
    Tags
    # Submissions
    44
    Accepted
    19
    Uploaded By