Grains in a Chessboard
TIME LIMIT = 5 SECS.
- A queen requested the services of a monk and told him she would pay any price.
The monk, needing food, asked the queen if the payment could be made in wheat grains arranged in a chessboard,
so that in the first square it would be put only one grain, and in the subsequent squares twice as much as its previous square.
The queen considered it a bargain and asked to the service be done. However, one of the riders who was present was good in math
and warned that it would be impossible to execute the payment, because the amount of grain needed would be very high.
The Queen then asked this gentleman who was good in calculation to develop a program that receives as input the number
of squares to be used in a checkerboard and informs the amount of corresponding kg of wheat, knowing that 12 grains of
the cereal correspond to one gram. Finally, the calculated amount should fit into an unsigned 64-bit integer number.
Input | Output |
A single line consisting of a single integer X(1 ≤ X ≤ 64), indicating the number of possible squares to be used. | Print the weight of the grains in KG. |