2551: BIGZHUGOD and His Friends I

内存限制:128 MB 时间限制:1.000 S
评测方式:文本比较 命题人:
提交:2 解决:2

题目描述

BIGZHUGOD and his three friends feel bored at home, then they decide to play a game called "niuniu".

The rules of "niuniu" are: first randomly pick 5 cards from all cards, then divide them into 2 groups, one group has 2 cards, and the other has 3 cards. If the sum of both groups are multiples of 10, then they are "niuniu". Moreover, A counts for 1, J, Q, K, black joker and red joker counts for 10.

BIGZHUGOD has an incomplete pack of card. And his three friends let BIGZHUGOD pick up 5 cards randomly, if they are "niuniu", BIGZHUGOD will gain meals from friends.

Now BIGZHUGOD knows the number of every kind of card, he wants to know the possibility that he can gain the meal. 

输入

The first line of input contains an integer T, indicating the number of test cases (T ≤ 500).

Each case there are 15 integers x1, x2, ..., x15 indicating the number of A, 2, 3, ..., 10, J, Q, K, black joker, red joker. 0 ≤ x1, x2, ..., x13 ≤ 4, 0 ≤ x14, x15 ≤ 1, x1 + x2 ... + x15 ≥ 5.

输出

For each case output in a single line, contains the possibility of BIGZHUGOD can get big meal from his friends.

If the possibility is 0, output 0.

Otherwise, output p/q, where p and q are co-prime integers (have no common divisor greater than one).

样例输入 复制

2
4 4 4 4 4 4 4 4 4 4 4 4 4 1 1
1 1 1 1 1 0 0 0 0 0 0 0 0 0 0

样例输出 复制

2681/35139
0