Codeforces Round 299 (Div. 1)
D
Tavas in Kansas
Codeforces
2900
原题
← CE →
翻译中…

Tavas lives in Kansas. Kansas has $*n*$ cities numbered from 1 to $*n*$ connected with $*m*$ bidirectional roads. We can travel from any city to any other city via these roads. Kansas is as strange as Tavas. So there may be a road between a city and itself or more than one road between two cities.

翻译中…

Tavas invented a game and called it "Dashti". He wants to play Dashti with his girlfriends, Nafas.

翻译中…

In this game, they assign an arbitrary integer value to each city of Kansas. The value of $*i*$-th city equals to $*p*_{*i*}$.

翻译中…

During the game, Tavas is in city $*s*$ and Nafas is in city $*t*$. They play in turn and Tavas goes first. A player in his/her turn, must choose a non-negative integer $*x*$ and his/her score increases by the sum of values of all cities with (shortest) distance no more than $*x*$ from his/her city. Each city may be used once, or in the other words, after first time a player gets score from a city, city score becomes zero.

翻译中…

There is an additional rule: the player must choose $*x*$ such that he/she gets the point of at least one city that was not used before. Note that city may initially have value 0, such city isn't considered as been used at the beginning of the game, i. e. each player may use it to fullfill this rule.

翻译中…

The game ends when nobody can make a move.

翻译中…

A player's score is the sum of the points he/she earned during the game. The winner is the player with greater score, or there is a draw if players score the same value. Both players start game with zero points.

翻译中…

image

翻译中…

If Tavas wins, he'll break his girlfriend's heart, and if Nafas wins, Tavas will cry. But if their scores are equal, they'll be happy and Tavas will give Nafas flowers.

翻译中…

They're not too emotional after all, so they'll play optimally. Your task is to tell Tavas what's going to happen after the game ends.

翻译中…

Input

翻译中…

The first line of input contains two integers $*n*$ and $*m*$ ($2 ≤ *n* ≤ 2000$, $*n* - 1 ≤ *m* ≤ 10^{5}$).

翻译中…

The second line of input contains two integers $*s*$ and $*t*$ ($1 ≤ *s*, *t* ≤ *n*$, $*s* ≠ *t*$).

翻译中…

The next line contains $*n*$ integers $*p*_{1}, *p*_{2}, ..., *p*_{*n*}$ separated by spaces ($|*p*_{*i*}| ≤ 10^{9}$).

翻译中…

The next $*m*$ lines contain the roads. Each line contains three integers $*v*, *u*, *w*$ and it means that there's an road with length $*w*$ between cities $*v*$ and $*u*$ ($1 ≤ *u*, *v* ≤ *n*$ and $0 ≤ *w* ≤ 10^{9}$). The road may lead from the city to itself, there may be several roads between each pair of cities.

翻译中…

Output

翻译中…

If Tavas wins, print "Break a heart". If Nafas wins print "Cry" and if nobody wins (i. e. the game ended with draw) print "Flowers".

翻译中…

样例

Input #1
4 4
1 2
3 2 5 -11
1 4 2
3 4 2
3 1 5
3 2 1
Output #1
Cry
InputCopy OutputCopy
Input #2
5 4
1 2
2 2 -5 -4 6
1 2 4
2 3 5
2 4 2
4 5 2
Output #2
Break a heart
InputCopy OutputCopy
Input #3
2 1
1 2
-5 -5
1 2 10
Output #3
Flowers
InputCopy OutputCopy
题目信息
题号
536D
时间限制
2 s
内存限制
512 MB
标签
动态规划
博弈论

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