Every one knows the golden ratio, the absolute value of golden ratio is ,about 0.618
Little Dingding is drawing lines parallel to axis on an infinite large paper. Of course, lines are infinitely long. Lines may intersect and form rectangles. Now he wants to know, how many rectangles are there which has golden ratio.
If the integer part of is the same as
,we say the rectangle has the golden ratio. Of cource ,width is the longer edge.
Problem I: 五队-大连-Golden ratio
Time Limit: 5 Sec Memory Limit: 128 MBSubmit: 24 Solved: 4
[Submit][Status][Web Board]
Description
Input
There are multiple test cases. Given (
) representing the number of lines.
Followed by integers,representing the lines parallel to X-axis (in the form Y=1 etc.) and then
integers,representing the lines parallel to Y-axis (
). Lines won’t overlap.
Process to end of file.
Output
For each case, print number of rectangles with the golden ratio.
Sample Input
3 3
0 9 10
0 16 17
Sample Output
2
HINT
한국어
中文
فارسی
English
ไทย
Anything about the Problems, Please Contact Admin:admin
All Copyright Reserved 2010-2013 ZJUT ONLINE JUDGE TEAM
GPL2.0 2003-2013 HUSTOJ Project TEAM
Anything about the Problems, Please Contact Admin:admin
All Copyright Reserved 2010-2013 ZJUT ONLINE JUDGE TEAM
GPL2.0 2003-2013 HUSTOJ Project TEAM