300980: CF185C. Clever Fat Rat

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Clever Fat Rat

题意翻译

顶层长度为$n$的倒金字塔,顶层每个位置有$a[i]$重量的麦子。 金字塔每个位置的承重为$w[i][j]$,如果在上面有大于等于这个重量的麦子,那么这个位置上的麦子就会滚到$(i+1,j-1),(i+1,j)$中的一个去(由你决定)。 如果你能使第$n$层的位置超过承重,那么输出Cerealguy,否则输出Fat Rat

题目描述

The Fat Rat and his friend Сerealguy have had a bet whether at least a few oats are going to descend to them by some clever construction. The figure below shows the clever construction. ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF185C/260a672b58fa6315db77723763ac5b1f82613cb9.png)A more formal description of the clever construction is as follows. The clever construction consists of $ n $ rows with scales. The first row has $ n $ scales, the second row has $ (n-1) $ scales, the $ i $ -th row has $ (n-i+1) $ scales, the last row has exactly one scale. Let's number the scales in each row from the left to the right, starting from $ 1 $ . Then the value of $ w_{i,k} $ in kilograms $ (1<=i<=n; 1<=k<=n-i+1) $ is the weight capacity parameter of the $ k $ -th scale in the $ i $ -th row. If a body whose mass is not less than $ w_{i,k} $ falls on the scale with weight capacity $ w_{i,k} $ , then the scale breaks. At that anything that the scale has on it, either falls one level down to the left (if possible) or one level down to the right (if possible). In other words, if the scale $ w_{i,k} $ $ (i&lt;n) $ breaks, then there are at most two possible variants in which the contents of the scale's pan can fall out: all contents of scale $ w_{i,k} $ falls either on scale $ w_{i+1,k-1} $ (if it exists), or on scale $ w_{i+1,k} $ (if it exists). If scale $ w_{n,1} $ breaks, then all its contents falls right in the Fat Rat's claws. Please note that the scales that are the first and the last in a row, have only one variant of dropping the contents. Initially, oats are simultaneously put on all scales of the first level. The $ i $ -th scale has $ a_{i} $ kilograms of oats put on it. After that the scales start breaking and the oats start falling down in some way. You can consider everything to happen instantly. That is, the scale breaks instantly and the oats also fall instantly. The Fat Rat is sure that whatever happens, he will not get the oats from the first level. Cerealguy is sure that there is such a scenario, when the rat gets at least some number of the oats. Help the Fat Rat and the Cerealguy. Determine, which one is right.

输入输出格式

输入格式


The first line contains a single integer $ n $ $ (1<=n<=50) $ — the number of rows with scales. The next line contains $ n $ space-separated integers $ a_{i} $ $ (1<=a_{i}<=10^{6}) $ — the masses of the oats in kilograms. The next $ n $ lines contain descriptions of the scales: the $ i $ -th line contains $ (n-i+1) $ space-separated integers $ w_{i,k} $ $ (1<=w_{i,k}<=10^{6}) $ — the weight capacity parameters for the scales that stand on the $ i $ -th row, in kilograms.

输出格式


Print "Fat Rat" if the Fat Rat is right, otherwise print "Cerealguy".

输入输出样例

输入样例 #1

1
1
2

输出样例 #1

Fat Rat

输入样例 #2

2
2 2
1 2
4

输出样例 #2

Cerealguy

输入样例 #3

2
2 2
1 2
5

输出样例 #3

Fat Rat

说明

Notes to the examples: - The first example: the scale with weight capacity 2 gets 1. That means that the lower scale don't break. - The second sample: all scales in the top row obviously break. Then the oats fall on the lower row. Their total mass is 4,and that's exactly the weight that the lower scale can "nearly endure". So, as 4 $ >= $ 4, the scale breaks.

Input

题意翻译

顶层长度为$n$的倒金字塔,顶层每个位置有$a[i]$重量的麦子。 金字塔每个位置的承重为$w[i][j]$,如果在上面有大于等于这个重量的麦子,那么这个位置上的麦子就会滚到$(i+1,j-1),(i+1,j)$中的一个去(由你决定)。 如果你能使第$n$层的位置超过承重,那么输出Cerealguy,否则输出Fat Rat

加入题单

算法标签: