5528: Guess the weight

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

题目描述

输入

输出

样例输入 复制

2
2 5
1 1
2
1 1 2
2
1 1 2
2
2 5
1 2
2
1 1 3
2
1 100 4
2

样例输出 复制

0/1
2/3
2/3
1/1
5/6
201/3502

提示

For the first test case of the sample, initially, the deck consists of two cards with mana cost 1. So no matter which choice one picks, he cannot draw the second card. After adding a card with mana cost 2 into the deck, the optimal strategy one can apply is as follows: If the mana cost of the first card drawn is 1, then he predicts that the next card has a greater cost, otherwise he predicts that the next card has a smaller mana cost. One can certify that under this strategy the probability of drawing the second card is 2/3. After adding another card with mana cost 2 into the deck, the optimal strategy doesn't change. One can certify that under this strategy the probability of drawing the second card is still 2/3.