Orange Boy Can You Solve It Out? Ep. 60

Solved!

Difficulty: Div2C

:O 竟然有60期了!! 本期题目来源于Group Theory作业,,,难度不高

Congratulations on the 60th entry!! This problem is from my Group Theory homework (not very hard).

Z(Sym(n))=ONE

In the world of MATHS, a permutation is a bijection f: {1,2,3,...,n}\to {1,2,3,...,n}.

For example for n=4:

  • Permutation: f(1)=2,f(2)=4,f(3)=3,f(4)=1 is a permutation.

  • but f(1)=5,f(2)=4,f(3)=3,f(4)=1 and f(1)=2,f(2)=4,f(3)=2,f(4)=1 are NOT.

Now, Ninetail has a permutation f(x) of order n and you want to get naughty. Find any permutation g(x) such that f(g(x))\neq g(f(x)). If there are multiple answers, print any. If there are none, print NO.

Examples

Input

f(1)=2,f(2)=3,f(3)=1,f(4)=4,f(5)=5

Output

g(1)=3,g(2)=2,g(3)=1,g(4)=4,g(5)=5

Explain

f(g(x))=1,3,2,4,5

g(f(x))=2,1,3,4,5

Input

f(1)=2,f(2)=1

Output

NO

Constraints

n\leq 10^6

Solutions

Solution By XGN

摸了,,,希望做法不假

版权声明:
作者:XGN
链接:https://blog.hellholestudios.top/archives/1385
来源:Hell Hole Studios Blog
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>
文章目录
关闭
目 录