#!/usr/bin/perl -w

use v5.16;

my ($xmin, $xmax) = (281, 311); my ($ymin, $ymax) = (-74, -54);
# my ($xmin, $xmax) = (20, 30); my ($ymin, $ymax) = (-10, -5);

my $count;
for my $dx (1 .. $xmax) {
for my $dy ($ymin..-$ymin) {
	my ($dx0, $dy0) = ($dx, $dy);
	my ($x, $y) = (0, 0);
	while ($x <= $xmax && $y >= $ymin) {
		if ($x >= $xmin && $x <= $xmax && $y >= $ymin && $y <= $ymax) {
			$count++;
			# say $dx,',', $dy;
			last;
		}
		$x += $dx0; $y += $dy0;
		if ($dx0 > 0) { $dx0-- };
		$dy0--;
	}
} }

say $count;
	
