2660Choosy in Food(测试数据有问题 )

2660   Choosy in Food(测试数据有问题 )

题目描述

    Xiao Ming find n trees (labeled 0...n-1) which join a circle in a magical land. Each tree
is covered with ripe berries. Xiao Ming wants to find the tree whose berries are most delicious. He starts from the tree X, walks clockwise to find the target. Each time the probability of him walking k trees is Pk% . P1+P2+..+Pk = 100

      Now we know the target of Xiao Ming is the tree Y. Require to know expectation of the number of the trees which Xiao Ming walk through

输入格式:

    The first parameter is T, indicates the case number.

    In each case, there are four integers at the first line, N, M, X , Y (Tree labels from 0 to N-1, N < 100, M < N).  

输出格式:

     The expectation of the number of trees Xiao Ming walk through. It will be reserved two decimal places. If Xiao Ming will never arrive the tree, output -1. 

输入样例 复制
2 
4 2 0 1
50 50 
4 1 0 2 
100
输出样例 复制
4.20
2.00

说明

0
1
通过提交
时空限制1000ms/1280mb
题目来源数据结构实验与竞赛训练
评测方式在线评测
题目类型
难        度