CF185C.Clever Fat Rat

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

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.

A more formal description of the clever construction is as follows. The clever construction consists of nn rows with scales. The first row has nn scales, the second row has (n1)(n-1) scales, the ii -th row has (ni+1)(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 11 . Then the value of wi,kw_{i,k} in kilograms (1<=i<=n; 1<=k<=ni+1)(1<=i<=n; 1<=k<=n-i+1) is the weight capacity parameter of the kk -th scale in the ii -th row.

If a body whose mass is not less than wi,kw_{i,k} falls on the scale with weight capacity wi,kw_{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 wi,kw_{i,k} (i<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 wi,kw_{i,k} falls either on scale wi+1,k1w_{i+1,k-1} (if it exists), or on scale wi+1,kw_{i+1,k} (if it exists). If scale wn,1w_{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 ii -th scale has aia_{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 nn (1<=n<=50)(1<=n<=50) — the number of rows with scales.

The next line contains nn space-separated integers aia_{i} (1<=ai<=106)(1<=a_{i}<=10^{6}) — the masses of the oats in kilograms.

The next nn lines contain descriptions of the scales: the ii -th line contains (ni+1)(n-i+1) space-separated integers wi,kw_{i,k} (1<=wi,k<=106)(1<=w_{i,k}<=10^{6}) — the weight capacity parameters for the scales that stand on the ii -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.
首页