eolymp
bolt
Try our new interface for solving problems
Məsələlər

Газон

Газон

Farmer Ivan from his youth watching his lawn. Lawn can be regarded as a plane, which at every point with integer coordinates, one tuft of grass grows. One Sunday Ivan took the mower and vows some rectangular area of lawn. Parties of this site are parallel to the axes, and the two opposite vertices are the points (\textbf{X}_1, \textbf{Y}_1) and (\textbf{X}_2, \textbf{Y}_2). It should be noted that the bundles of grass located on the border of the rectangle, also were tonsured. Pleased with the result of Ivan bought and installed on the lawn sprinklers. She was placed at coordinates (\textbf{X}_3, \textbf{Y}_3)and had a radius of the jet \textbf{R}. Thus, the installation began to pour all the beams, the distance from which to point (\textbf{X}_3,\textbf{Y}_3) is not greater than \textbf{R}. Everything was good, but Ivan's interested in the question: how many bundles of grass and was tonsured, and poured into this Sunday? Write a program that will give an answer to the question of Ivan. \InputFile The first line contains four integers \textbf{X}_1, \textbf{Y}_1, \textbf{X}_2, \textbf{Y}_2 (-\textbf{10^5} ≤ \textbf{X}_1 < \textbf{X}_\{2 \}≤ \textbf{10^5}; -\textbf{10^5} ≤ \textbf{Y}_1 < \textbf{Y}_\{2 \}≤ \textbf{10^5}). The second line contains three integers \textbf{X}_3, \textbf{Y}_3, \textbf{R} (-\textbf{10^5} ≤ \textbf{X}_3, \textbf{Y}_3 ≤ \textbf{10^5}; \textbf{1} ≤ \textbf{R}_\{ \}≤ \textbf{10^5}). \OutputFile Print the number of tufts of grass, which were tonsured, and watered. \textbf{Illustration example} \includegraphics{https://static.e-olymp.com/content/e7/e70f767e79ebba2b7bf589d2e86b39a2a6f61be0.jpg}
Zaman məhdudiyyəti 2 saniyə
Yaddaşı istafadə məhdudiyyəti 64 MiB
Giriş verilənləri #1
0 0 5 4
4 0 3
Çıxış verilənləri #1
14