CF630M Turn

题目描述

Vasya开始在某城的机器视觉公司工作。Vasya 的团队开发了通过脸部识别人的软件和硬件。这个项目的诀窍之一就是在拍摄时摄像机绕着光轴旋转。人们看到一个引人注目的小玩意ーー一个旋转的照相机ーー走到它面前,以便更好地观察它,观察它。照相机拍下了他们的照片。还有什么能更好地进行高质量的鉴定呢? 但不是每件事都这么简单。来自相机的图片也出现了旋转(在顺时针相机旋转框架内容成为逆时针旋转)。但是这种识别算法只适用于略微偏离垂直方向的人脸。 vasya 负责纠正这种情况ーー旋转捕捉到的图像,使图像与垂直方向的偏差微乎其微。要求很严格。首先,图片应该只旋转角度可分为90度,不失去一点点的信息,图像。其次,由于摄像机的帧数太大,帧数太大,只有硬件 fpga 解决方案才能提供足够的旋转速度。这种溶液只能顺时针旋转90度。当然,一个人可以使用90度旋转几次,但为了性能起见,旋转的次数应该是最少的。帮助 vasya 实现这个程序,根据给定的相机旋转角度,可以确定90度顺时针旋转的最小次数,从而得到一张垂直方向偏离最小的图片。箭头指向“ true up”。 ![abc](https://cdn.luogu.com.cn/upload/vjudge_pic/CF630M/0a70d06294ba14cf6932d88e73f7104a80a47ffd.png)下图显示了 fpga 硬件90度顺时针旋转。 ![bcd](https://cdn.luogu.com.cn/upload/vjudge_pic/CF630M/27415d2b40a093696eff613b76f89792e0d969f3.png)

输入格式

输入的唯一一行包含一个整数 x (- 10 ^ 18 < = x < = 10 ^ 18)ー摄像机角度度数。正值表示照相机顺时针旋转,负值表示逆时针旋转。

输出格式

输出一个整数——时针旋转90度所需的最少次数。

说明/提示

When the camera is rotated $ 60 $ degrees counter-clockwise (the second example), an image from it is rotated $ 60 $ degrees clockwise. One $ 90 $ degrees clockwise turn of the image result in $ 150 $ degrees clockwise total rotation and deviation from "true up" for one turn is $ 150 $ degrees. Two $ 90 $ degrees clockwise turns of the image result in $ 240 $ degrees clockwise total rotation and deviation from "true up" for two turns is $ 120 $ degrees because $ 240 $ degrees clockwise equal to $ 120 $ degrees counter-clockwise. Three $ 90 $ degrees clockwise turns of the image result in $ 330 $ degrees clockwise total rotation and deviation from "true up" for three turns is $ 30 $ degrees because $ 330 $ degrees clockwise equal to $ 30 $ degrees counter-clockwise. From $ 60 $ , $ 150 $ , $ 120 $ and $ 30 $ degrees deviations the smallest is $ 30 $ , and it it achieved in three $ 90 $ degrees clockwise turns.