Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void solve() {
- long x = in.readLong();
- long y = in.readLong();
- long r = in.readLong();
- long[] squares = new long[1000001];
- for(long i = 0; i <= 1000000; i++) {
- squares[(int) i] = i * i;
- }
- long result = 0;
- for(long i = 0; i < r; i++) {
- long current = r * r - i * i;
- int b = Arrays.binarySearch(squares, current);
- if(b < 0) {
- b = ~b;
- }
- result += b;
- }
- out.println(4 * result);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement