시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 172 31 28 39.437%

문제

아래와 같이 물음표를 포함한 부등식이 있다.

이때, 부등식이 성립하게 물음표를 양의 정수로 바꾸는 경우의 수는 모두 몇 개가 있을까?

입력

첫째 줄에 B, C, D가 주어진다. (1 ≤ B, C, D ≤ 1000)

둘째 줄에 A1, A2가 주어진다. (1 ≤ A1, A2 ≤ 1000)

셋째 줄에 E1, E2가 주어진다. (1 ≤ E1, E2 ≤ 1000)

출력

첫째 부등식을 만족하게 물음표를 양의 정수로 바꾸는 방법의 수를 출력한다.

예제 입력 1

1 9 7
14 5
10 3

예제 출력 1

3

힌트

        

W3sicHJvYmxlbV9pZCI6IjMxMTAiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWJkODBcdWI0ZjFcdWMyZGQiLCJkZXNjcmlwdGlvbiI6IjxwPlxyXG5cdFx1YzU0NFx1Yjc5OFx1YzY0MCBcdWFjMTlcdWM3NzQgXHViYjNjXHVjNzRjXHVkNDVjXHViOTdjIFx1ZDNlY1x1ZDU2OFx1ZDU1YyBcdWJkODBcdWI0ZjFcdWMyZGRcdWM3NzQgXHVjNzg4XHViMmU0LjxcL3A+XHJcblxyXG48cD5cclxuXHQ8aW1nIGFsdD1cIlwiIHNyYz1cIlwvdXBsb2FkXC9pbWFnZXNcL2RhdW1fZXF1YXRpb25fMTM1ODI2NzYzMjg0OS5wbmdcIiBzdHlsZT1cIndpZHRoOiAyNTRweDsgaGVpZ2h0OiA2NXB4O1wiIFwvPjxcL3A+XHJcblxyXG48cD5cclxuXHRcdWM3NzRcdWI1NGMsIFx1YmQ4MFx1YjRmMVx1YzJkZFx1Yzc3NCBcdWMxMzFcdWI5YmRcdWQ1NThcdWFjOGMgXHViYjNjXHVjNzRjXHVkNDVjXHViOTdjIFx1YzU5MVx1Yzc1OCBcdWM4MTVcdWMyMThcdWI4NWMgXHViYzE0XHVhZmI4XHViMjk0IFx1YWNiZFx1YzZi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