【例17.2】 蜗牛爬行
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
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
20251122 A班作业(7)
- Status
- Done
- Problem
- 7
- Open Since
- 2025-11-22 0:00
- Deadline
- 2025-11-30 23:59
- Extension
- 24 hour(s)