Logo
(追記) (追記ここまで)

24064번 - Intersections 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB111564850.000%

문제

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.

제한

  • $\left\vert a \right\vert \le 10^9$; $a \ne 0$
  • $a$ is an integer.

예제 입력 1

2

예제 출력 1

2

힌트

출처

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /