fork download
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main() {
  6. ios::sync_with_stdio(false);
  7. cin.tie(nullptr);
  8.  
  9. int r;
  10. cin >> r;
  11. int count = 4*r + 1;
  12.  
  13.  
  14. for (int i = 1; i<=r; i++){
  15. count += 4*floor(sqrt(r*r-i*i));
  16. }
  17. cout << count;
  18. return 0;
  19. }
Success #stdin #stdout 0.01s 5312KB
stdin
7
stdout
149