시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 512 MB | 59 | 37 | 33 | 70.213% |
You are given the following two functions. ($\mathbb{N}_0$ denotes the set of non-negative integers.)
$$f(x)= \begin{cases} 0, & \mbox{if } x < 0 \\ x - 2k, & \mbox{if } 2k \le x < 2k+1 \, (k \in \mathbb{N}_0) \\ -x + 2(k+1) & \mbox{if } 2k + 1 \le x < 2k+2 \, (k \in \mathbb{N}_0) \end{cases}$$
$$g(x) = {x \over a}$$
How many intersections between the graphs of $y=f(x)$ and $y=g(x)$ exist on the XY-plane?
The first and only line of the input contains a single integer $a$.
Print the number of intersections between the graphs of $y = f(x)$ and $y = g(x)$. If there are infinitely many intersections, print INF
.
2
2