def count(r) r2 = r*r ; ptsx = [] ; ptsy = [] (0..r-1).each { |x| x2 = x*x (0..r-1).each { |y| y2 = y*y if x2+y2 < r2 ptsx << x ; ptsy << y if x != 0 ptsx << -x ; ptsy << y end if y != 0 ptsx << x ; ptsy << -y if x != 0 ptsx << -x ; ptsy << -y end end end } } puts < static const int ptslen=#{ptsx.length}; static const int ptsx[]={#{ptsx.join(', ')}}; static const int ptsy[]={#{ptsy.join(', ')}}; int main(void) { int i, j, k, xi, yi, xj, yj, xk, yk, tmp; unsigned long long cnt=0; for (i=0 ; i 0) for (k=j ; kyj*xk && xk*yi>yk*xi) cnt++; } else if (tmp < 0) for (k=j ; k