P2997 [USACO10NOV] Banner S

Background

题目大意(by:曹彦臣): 平面上有(0,0)到(n,m)的(n+1)\*(m+1)个点。问有多少点对所连的线段不过其他点,且长度在[l,h]范围内。

Description

Bessie is returning from a long trip abroad, and Farmer John wants to erect a nice 'Welcome Home' banner in her pasture for her arrival. The banner will hang between two poles on a wire whose length is in the range L1..L2 (1

Input Format

\* Line 1: Four space-separated integers: W, H, L1, and L2

Output Format

\* Line 1: A single integer denoting the number of possible banners