CF863G.Graphic Settings

普及/提高-

通过率:0%

AC君温馨提醒

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

题目描述

Recently Ivan bought a new computer. Excited, he unpacked it and installed his favourite game. With his old computer Ivan had to choose the worst possible graphic settings (because otherwise the framerate would be really low), but now he wants to check, maybe his new computer can perform well even with the best possible graphics?

There are mm graphics parameters in the game. ii -th parameter can be set to any positive integer from 11 to aia_{i} , and initially is set to bib_{i} ( bi<=aib_{i}<=a_{i} ). So there are different combinations of parameters. Ivan can increase or decrease any of these parameters by 11 ; after that the game will be restarted with new parameters (and Ivan will have the opportunity to check chosen combination of parameters).

Ivan wants to try all pp possible combinations. Also he wants to return to the initial settings after trying all combinations, because he thinks that initial settings can be somehow best suited for his hardware. But Ivan doesn't really want to make a lot of restarts.

So he wants you to tell the following:

  • If there exists a way to make exactly pp changes (each change either decreases or increases some parameter by 11 ) to try all possible combinations and return to initial combination, then Ivan wants to know this way.
  • Otherwise, if there exists a way to make exactly p1p-1 changes to try all possible combinations (including the initial one), then Ivan wants to know this way.

Help Ivan by showing him the way to change parameters!

输入格式

The first line of input contains one integer number mm ( 1<=m<=61<=m<=6 ).

The second line contains mm integer numbers a1,a2,...,ama_{1},a_{2},...,a_{m} ( 2<=ai<=10002<=a_{i}<=1000 ). It is guaranteed that .

The third line contains mm integer numbers b1,b2,...,bmb_{1},b_{2},...,b_{m} ( 1<=bi<=ai1<=b_{i}<=a_{i} ).

输出格式

If there is a way to make exactly pp changes (each change either decreases or increases some parameter by 11 ) to try all possible combinations and return to initial combination, then output Cycle in the first line. Then pp lines must follow, each desribing a change. The line must be either inc x (increase parameter xx by 11 ) or dec x (decrease it).

Otherwise, if there is a way to make exactly p1p-1 changes to try all possible combinations (including the initial one), then output Path in the first line. Then p1p-1 lines must follow, each describing the change the same way as mentioned above.

Otherwise, output No.

输入输出样例

  • 输入#1

    1
    3
    1
    

    输出#1

    Path
    inc 1
    inc 1
    
  • 输入#2

    1
    3
    2
    

    输出#2

    No
    
  • 输入#3

    2
    3 2
    1 1
    

    输出#3

    Cycle
    inc 1
    inc 1
    inc 2
    dec 1
    dec 1
    dec 2
    
首页