Codeforces Round 332 (Div. 2)
A
Patrick and Shopping
Codeforces
800
原题
←B →
翻译中…

Today Patrick waits for a visit from his friend Spongebob. To prepare for the visit, Patrick needs to buy some goodies in two stores located near his house. There is a $*d*_{1}$ meter long road between his house and the first shop and a $*d*_{2}$ meter long road between his house and the second shop. Also, there is a road of length $*d*_{3}$ directly connecting these two shops to each other. Help Patrick calculate the minimum distance that he needs to walk in order to go to both shops and return to his house.

翻译中…

image

翻译中…

Patrick always starts at his house. He should visit both shops moving only along the three existing roads and return back to his house. He doesn't mind visiting the same shop or passing the same road multiple times. The only goal is to minimize the total distance traveled.

翻译中…

Input

翻译中…

The first line of the input contains three integers $*d*_{1}$, $*d*_{2}$, $*d*_{3}$ ($1 ≤ *d*_{1}, *d*_{2}, *d*_{3} ≤ 10^{8}$) — the lengths of the paths.

翻译中…
  • $*d*_{1}$ is the length of the path connecting Patrick's house and the first shop;
  • $*d*_{2}$ is the length of the path connecting Patrick's house and the second shop;
  • $*d*_{3}$ is the length of the path connecting both shops.
翻译中…

Output

翻译中…

Print the minimum distance that Patrick will have to walk in order to visit both shops and return to his house.

翻译中…

Note

翻译中…

The first sample is shown on the picture in the problem statement. One of the optimal routes is: house image first shop image second shop image house.

翻译中…

In the second sample one of the optimal routes is: house image first shop image house image second shop image house.

翻译中…

样例

Input #1
10 20 30
Output #1
60
InputCopy OutputCopy
Input #2
1 1 5
Output #2
4
InputCopy OutputCopy
题目信息
题号
599A
时间限制
1 s
内存限制
256 MB
标签
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。