OTHS Coding Competition 4 P1 - Square Root Decomposition

View as PDF

Submit solution

Points: 3
Time limit: 2.0s
Java 4.0s
Python 4.0s
Memory limit: 512M
Java 1G
Python 1G

Author:
Problem type

As summer arrives in Teyvat, so have the dandelions. Noelle has taken on the task of removing and decomposing them with their roots. To her convenience, the guild has square-shaped decomposing gadgets that can decompose a dandelion encompassed in the square.

Given the dandelion with maximum radius of R, help Noelle determine the minimum perimeter of the square gadget she will need.

Constraints

1 \le R \le 10^8

Input Specification

A single line containing an integer R.

Output Specification

A single line containing the minimum perimeter as an integer.

Sample Input 1

8

Sample Output 1

64

Explanation for Sample 1

A circle of radius 8 requires a square of minimum perimeter 64.

Sample Input 2

4

Sample Output 2

32

Sample Input 3

17279317

Sample Output 3

138234536

Comments

There are no comments at the moment.

OSZAR »