#include <iostream>
using namespace std;
int main() {
long long i,j,r,n;
cout<<"r = "; cin>>r;
i=r; j=1; n=0;
while (i>=1) {
while (i*i+j*j<=r*r) j=j+1;
n=n+r-j+1;
i--;
}
n=2*(2*r+1)-1+4*r*r-n*4;
cout<<n<<endl;
system("pause");
return(0);
#include <iostream>
using namespace std;
int main() {
long long i,j,r,n;
cout<<"r = "; cin>>r;
i=r; j=1; n=0;
while (i>=1) {
while (i*i+j*j<=r*r) j=j+1;
n=n+r-j+1;
i--;
}
n=2*(2*r+1)-1+4*r*r-n*4;
cout<<n<<endl;
system("pause");
return(0);
}