package ycoder; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class CircleLatticePoint { public static void main(String... string) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] tmp = br.readLine().split(" "); int rMin = Integer.parseInt(tmp[0]); int rMax = Integer.parseInt(tmp[1]); CircleLatticePoint clp = new CircleLatticePoint(); int maxLatticePoint = 0; for(int r = rMin; r <= rMax; r++) { if(r == rMin) maxLatticePoint = clp.getLatticePoint(r); if(clp.getLatticePoint(r) > maxLatticePoint) { maxLatticePoint = clp.getLatticePoint(r); } } System.out.println(maxLatticePoint); } public int getLatticePoint(int r) { int result = 0; for(int x = 0; x <= Math.sqrt(r); x++) { for(int y = 0; y < Math.sqrt(r); y++) { if(r == x*x + y*y) { result++; } } } result = result * 4; return result; } }