fork download
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main() {
  6. // your code goes here
  7. int cnt=0,h=5,w=5,x=4,r,c;
  8. // cin>>h>>w>>x;
  9. for(r=1;r<=h;++r){
  10. for(c=1;c<=w;++c){
  11. if(sqrt(r*r+c*c)<=x+r-c) cnt++;
  12. }
  13. }
  14. cout<<cnt;
  15. return 0;
  16. }
Success #stdin #stdout 0.01s 5320KB
stdin
Standard input is empty
stdout
12