시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 171 30 27 38.571%

문제

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

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

입력

첫째 줄에 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+XHJcblxyXG48cD5cclxuXHRcdWM3NzQgXHViNTRjLCBcdWJkODBcdWI0ZjFcdWMyZGRcdWM3NzQgXHVjMTMxXHViOWJkXHVkNTU4XHVhYzhjIFx1YmIzY1x1Yzc0Y1x1ZDQ1Y1x1Yjk3YyBcdWM1OTFcdWM3NTggXHVjODE1XHVjMjE4XHViODVjIFx1YmMxNFx1YWZiOFx1YjI5NCBcdWFjYmRcd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