#P93. 【例17.2】 蜗牛爬行
【例17.2】 蜗牛爬行
Description
A snail is preparing to journey to a mysterious kingdom. It is known that it needs to eat vegetable leaves to replenish energy while crawling. For the first centimeters of its journey, it eats milligrams of vegetable leaves per centimeter. For any distance beyond centimeters, it eats milligrams of vegetable leaves per centimeter. Given that today it crawled centimeters towards the mysterious kingdom, how many milligrams of vegetable leaves will it eat?
Input Format
Input is an integer , representing the distance the snail crawled ().
Output Format
Output a single line containing one integer, representing the number of milligrams of vegetable leaves the snail ate.
Sample
525
Related
In following homework: