Takahashikun, The Strider

AtCoder
IDagc046_a
Time2000ms
Memory256MB
Difficulty
Takahashi is standing on a two-dimensional plane, facing north. Find the minimum positive integer $K$ such that Takahashi will be at the starting position again after he does the following action $K$ times: * Go one meter in the direction he is facing. Then, turn $X$ degrees counter-clockwise. ## Constraints * $1 \leq X \leq 179$ * $X$ is an integer. ## Input Input is given from Standard Input in the following format: $X$ [samples]
Samples
Input #1
90
Output #1
4

Takahashi's path is a square.
Input #2
1
Output #2
360
API Response (JSON)
{
  "problem": {
    "name": "Takahashikun, The Strider",
    "description": {
      "content": "Takahashi is standing on a two-dimensional plane, facing north. Find the minimum positive integer $K$ such that Takahashi will be at the starting position again after he does the following action $K$ ",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "agc046_a"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Takahashi is standing on a two-dimensional plane, facing north. Find the minimum positive integer $K$ such that Takahashi will be at the starting position again after he does the following action $K$ ...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments