303598: CF696C. PLEASE

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

Description

PLEASE

题意翻译

### 题目描述 正如我们所知道的,Barney的工作是"PLEASE"并且ta工作时不需要做太多事情。这就是ta开始玩"cups and key"的原因。在这个游戏中有三个完全相同的杯子从左到右排成一行。最初,通往Barney心房的钥匙在中间的杯子下面 游戏总共有$n$个回合,每个回合中,Barney等概率地选择两侧杯子的其中一个与中间的杯子交换位置,钥匙始终在原来的杯子中 游戏结束后,Barney要求一位女装大佬(就是你)答出钥匙在中间杯子中的概率 由于回合非常多,ta给了你一个数组`a[k]`,$n=\prod_{i=1}^k a_i$ 最后的答案化为形如`p/q`的最简分数形式后,分子分母同对$1e9+7$取模 ### 输入输出格式 #### 输入格式: 第一行为给定数组的长度$k(1\leq k \leq 1e5)$ 第二行$k$个整数为给定的数组$a(1 \leq a_i \leq 1e18)$ #### 输出格式: 一行,最后的答案

题目描述

As we all know Barney's job is "PLEASE" and he has not much to do at work. That's why he started playing "cups and key". In this game there are three identical cups arranged in a line from left to right. Initially key to Barney's heart is under the middle cup. ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF696C/f5c86067ed4a2db280b505f1cf38476a32a2d9f0.png)Then at one turn Barney swaps the cup in the middle with any of other two cups randomly (he choses each with equal probability), so the chosen cup becomes the middle one. Game lasts $ n $ turns and Barney independently choses a cup to swap with the middle one within each turn, and the key always remains in the cup it was at the start. After $ n $ -th turn Barney asks a girl to guess which cup contains the key. The girl points to the middle one but Barney was distracted while making turns and doesn't know if the key is under the middle cup. That's why he asked you to tell him the probability that girl guessed right. Number $ n $ of game turns can be extremely large, that's why Barney did not give it to you. Instead he gave you an array $ a_{1},a_{2},...,a_{k} $ such that ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF696C/b07c8ff46a483f6c119ac1b5689468b55c19bff3.png)in other words, $ n $ is multiplication of all elements of the given array. Because of precision difficulties, Barney asked you to tell him the answer as an irreducible fraction. In other words you need to find it as a fraction $ p/q $ such that ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF696C/51ec39c66543471c5d07d25bd208f63da92bf471.png), where ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF696C/9ecd8274ff74f04a3c110790f7ff835d44a6c25f.png) is the greatest common divisor. Since $ p $ and $ q $ can be extremely large, you only need to find the remainders of dividing each of them by $ 10^{9}+7 $ . Please note that we want ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF696C/9ecd8274ff74f04a3c110790f7ff835d44a6c25f.png) of $ p $ and $ q $ to be $ 1 $ , not ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF696C/9ecd8274ff74f04a3c110790f7ff835d44a6c25f.png) of their remainders after dividing by $ 10^{9}+7 $ .

输入输出格式

输入格式


The first line of input contains a single integer $ k $ ( $ 1<=k<=10^{5} $ ) — the number of elements in array Barney gave you. The second line contains $ k $ integers $ a_{1},a_{2},...,a_{k} $ ( $ 1<=a_{i}<=10^{18} $ ) — the elements of the array.

输出格式


In the only line of output print a single string $ x/y $ where $ x $ is the remainder of dividing $ p $ by $ 10^{9}+7 $ and $ y $ is the remainder of dividing $ q $ by $ 10^{9}+7 $ .

输入输出样例

输入样例 #1

1
2

输出样例 #1

1/2

输入样例 #2

3
1 1 1

输出样例 #2

0/1

Input

题意翻译

### 题目描述 正如我们所知道的,Barney的工作是"PLEASE"并且ta工作时不需要做太多事情。这就是ta开始玩"cups and key"的原因。在这个游戏中有三个完全相同的杯子从左到右排成一行。最初,通往Barney心房的钥匙在中间的杯子下面 游戏总共有$n$个回合,每个回合中,Barney等概率地选择两侧杯子的其中一个与中间的杯子交换位置,钥匙始终在原来的杯子中 游戏结束后,Barney要求一位女装大佬(就是你)答出钥匙在中间杯子中的概率 由于回合非常多,ta给了你一个数组`a[k]`,$n=\prod_{i=1}^k a_i$ 最后的答案化为形如`p/q`的最简分数形式后,分子分母同对$1e9+7$取模 ### 输入输出格式 #### 输入格式: 第一行为给定数组的长度$k(1\leq k \leq 1e5)$ 第二行$k$个整数为给定的数组$a(1 \leq a_i \leq 1e18)$ #### 输出格式: 一行,最后的答案

加入题单

算法标签: