CF696C.PLEASE

普及/提高-

通过率:0%

AC君温馨提醒

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

题目描述

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.

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 nn 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 nn -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 nn of game turns can be extremely large, that's why Barney did not give it to you. Instead he gave you an array a1,a2,...,aka_{1},a_{2},...,a_{k} such that

in other words, nn 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/qp/q such that , where is the greatest common divisor. Since pp and qq can be extremely large, you only need to find the remainders of dividing each of them by 109+710^{9}+7 .

Please note that we want of pp and qq to be 11 , not of their remainders after dividing by 109+710^{9}+7 .

输入格式

The first line of input contains a single integer kk ( 1<=k<=1051<=k<=10^{5} ) — the number of elements in array Barney gave you.

The second line contains kk integers a1,a2,...,aka_{1},a_{2},...,a_{k} ( 1<=ai<=10181<=a_{i}<=10^{18} ) — the elements of the array.

输出格式

In the only line of output print a single string x/yx/y where xx is the remainder of dividing pp by 109+710^{9}+7 and yy is the remainder of dividing qq by 109+710^{9}+7 .

输入输出样例

  • 输入#1

    1
    2
    

    输出#1

    1/2
    
  • 输入#2

    3
    1 1 1
    

    输出#2

    0/1
    
首页