{"problem":{"name":"C. Help Victoria the Wise","description":{"content":"Vasilisa the Wise from a far away kingdom got a present from her friend Helga the Wise from a farther away kingdom. The present is a surprise box, yet Vasilisa the Wise doesn't know yet what the surpr","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF99C"},"statements":[{"statement_type":"Markdown","content":"Vasilisa the Wise from a far away kingdom got a present from her friend Helga the Wise from a farther away kingdom. The present is a surprise box, yet Vasilisa the Wise doesn't know yet what the surprise actually is because she cannot open the box. She hopes that you can help her in that.\n\nThe box's lock is constructed like that. The box itself is represented by an absolutely perfect black cube with the identical deepening on each face (those are some foreign nanotechnologies that the far away kingdom scientists haven't dreamt of). The box is accompanied by six gems whose form matches the deepenings in the box's faces. The box can only be opened after it is correctly decorated by the gems, that is, when each deepening contains exactly one gem. Two ways of decorating the box are considered the same if they can be obtained one from the other one by arbitrarily rotating the box (note that the box is represented by a perfect nanotechnological cube)\n\nNow Vasilisa the Wise wants to know by the given set of colors the following: in how many ways would she decorate the box in the worst case to open it? To answer this question it is useful to know that two gems of one color are indistinguishable from each other. Help Vasilisa to solve this challenging problem.\n\n## Input\n\nThe first line contains exactly 6 characters without spaces from the set {_R_, _O_, _Y_, _G_, _B_, _V_} — they are the colors of gems with which the box should be decorated.\n\n## Output\n\nPrint the required number of different ways to decorate the box.\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"来自遥远王国的智慧女巫瓦西莉萨收到了来自更遥远王国的朋友海格娜的礼物。这是一份惊喜盒，但瓦西莉萨还不知道惊喜是什么，因为她打不开这个盒子。她希望你能帮助她。\n\n盒子的锁构造如下：盒子本身是一个绝对完美的黑色立方体，每个面上都有一个相同的凹槽（这是遥远王国科学家们尚未梦想到的某种外来纳米技术）。盒子配有六颗宝石，其形状与盒子各面的凹槽完全匹配。只有当每个凹槽中恰好放入一颗宝石时，盒子才能被打开。如果两种装饰方式可以通过任意旋转盒子相互得到，则认为它们是相同的（注意，盒子是一个完美的纳米技术立方体）。\n\n现在，瓦西莉萨想知道：给定一组颜色，最坏情况下她有多少种不同的方式装饰盒子以打开它？为了回答这个问题，需要注意的是，同一种颜色的两颗宝石是无法区分的。请帮助瓦西莉萨解决这个具有挑战性的问题。\n\n第一行包含恰好 #cf_span[6] 个来自集合 {_R_, _O_, _Y_, _G_, _B_, _V_} 的无空格字符——它们是用于装饰盒子的宝石的颜色。\n\n## Input\n\n第一行包含恰好 #cf_span[6] 个来自集合 {_R_, _O_, _Y_, _G_, _B_, _V_} 的无空格字符——它们是用于装饰盒子的宝石的颜色。\n\n## Output\n\n请输出装饰盒子的不同方式的所需数量。\n\n[samples]","is_translate":true,"language":"Chinese"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ C = (c_1, c_2, c_3, c_4, c_5, c_6) $ be a multiset of 6 colors, each from the set $ \\{R, O, Y, G, B, V\\} $, representing the available gems.  \n\nLet $ G $ be the rotation group of the cube, with $ |G| = 24 $.  \n\nLet $ X $ be the set of all assignments of the 6 gems to the 6 faces of the cube, accounting for gem multiplicities:  \n$$\n|X| = \\frac{6!}{\\prod_{\\text{color } c} m_c!}\n$$\nwhere $ m_c $ is the multiplicity of color $ c $ in $ C $.  \n\nLet $ X/G $ denote the set of orbits under the action of $ G $ on $ X $ (i.e., distinct colorings up to rotation).  \n\n**Objective**  \nCompute $ |X/G| $, the number of distinct ways to assign the gems to the cube’s faces up to rotational symmetry.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF99C","tags":["brute force"],"sample_group":[["YYYYYY","1"],["BOOOOB","2"],["ROYGBV","30"]],"created_at":"2026-03-03 11:00:39"}}