Tokens re-collection
P1042 Tokens re-collection
Problem Background
AppOfficer didn't run out of the maze. All his tokens were snatched by Cui2010. Now he wants to
get all his tokens back. Unfortunately, he can't.
Problem Statement
Now AppOfficer is trapped in a hole. He's at point . The exit is at point . His tokens are placed in some parts of the hole. There are edges. For each edge, there're three integers , means that he can go directly from point to point in minutes. But he can't go from to ! AppOfficer not only wants to get his tokens back, but also wants to escape the hole ASAP. So if he gets tokens back, and he reaches point in minutes, he wants to minimize . Please tell him the product. If he cannot reach point n
, print Czy you don't have force morality! Rat tail juice!
.
Input
The first line includes three integers , , .
The second line includes integers, they mean where AppOfficer's tokens are.
Next lines, every line includes three integers , , , describing an edge.
Output
One integer, the product. Or Czy you don't have force morality! Rat tail juice!
Constraints
Samples
Input 1
Output 1
There're two kinds of ways to reach point .
- time: , tokens: . So the product is
- time: , tokens: . So the product is
Input 2
Output 2
It's obvious that AppOfficer cannot escape the hole.
信息
- ID
- 1042
- 难度
- 1150
- 分类
- (无)
- 标签
- 递交数
- 62
- 已通过
- 4
- 通过率
- 6%
- 被复制
- 2
- 上传者
相关
在下列比赛中: