시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 1024 MB111100.000%

문제

Consider a 2D plane of points with integer coordinates. The Taxi-cab Distance between two points is a measure of the shortest path between the points where movement is restricted to only horizontal and vertical paths, similar to following the lines on traditional graph paper. Each point connects to exactly four others, and each is one unit away.

The Spidey Distance is a similar measure of the shortest path, but allows movement horizontally, vertically, or along diagonal paths. Horizontal and vertical points are separated by one unit, but diagonal points are $1.5$ units away. Thus, each point connects to eight other points, four of which are one unit away and four of which are $1.5$ units away.

Write a program to compute the fraction of the number of points reachable via a given taxi-cab distance from a point, within an area defined by a spidey distance around that point.

입력

The single line of input contains two integers $t$ and $s$ ($0 \le t,s \le 10^6$), where $t$ is a taxi-cab distance, and $s$ is a spidey distance.

출력

Output a fraction in the form $n$/$d$, which is the fraction of points within the given spidey distance that can also be reached within the given taxi-cab distance. Output this fraction reduced to lowest form. If $d=1$ only output $n$. Do not output any spaces around the $/$.

예제 입력 1

4 4

예제 출력 1

41/49

예제 입력 2

6 6

예제 출력 2

17/21

예제 입력 3

3 7

예제 출력 3

25/141

예제 입력 4

7 3

예제 출력 4

1

출처

ICPC > Regionals > North America > North America Qualification Contest > ICPC North America Qualifier 2022 L번

  • 문제를 만든 사람: Dwayne Towell