2014
11-27

# A secret of 《The Tai Chi Master》

Do you remember a TV play called “The Tai Chi Master” in 1990s. In this play, the leading role Yang Yuqian (actor is Wu Jing) is fond of Tai Ji and becomes a great master at last. However, the Chen Style Taiji was only open to family Chen. So Yang Yuqian decides to steal the skill with the help from a teenager called Chen Shaoqi. They are best friends, and Shaoqi is the “son” of Chen family leader. But one day, Chen Zhenying, Shaoqi’s father, found Yang Yuqian and decided to drive him away. Chen Zhenying is interested in math. So he gives Yang Yuqian a chance: if Yang can solve his problem, then Yang can be his new apprentice.

The problem is that : C is a circle of Taiji in figure-1. In figure-2, the C is a circle and its centre is (0, 0). Its radius is R.is a line integral in plural plane according to the circle C and its direction is anti-clockwise. We define The Yang Yuqian’s dream will come true only if  I  is calculated.

Multiply cases. First line is number of test cases.
Each test case consisted of 7 integers. a,b,c,d,x,y,R represent the a,b,c,d,R in description and x,y represent the real part and imaginary part of Z0. a,b,c,x,y∈(-10000,10000);d∈(-10000,0)∪(0,10000);R∈(0,10000)

Multiply cases. First line is number of test cases.
Each test case consisted of 7 integers. a,b,c,d,x,y,R represent the a,b,c,d,R in description and x,y represent the real part and imaginary part of Z0. a,b,c,x,y∈(-10000,10000);d∈(-10000,0)∪(0,10000);R∈(0,10000)

2
0 0 0 1 0 0 1
1 2 1 1 1 0 1

0.0000
-18.8496i

1. 题目需要求解的是最小值，而且没有考虑可能存在环，比如
0 0 0 0 0
1 1 1 1 0
1 0 0 0 0
1 0 1 0 1
1 0 0 0 0
会陷入死循环

2. 约瑟夫也用说这么长……很成熟的一个问题了，分治的方法解起来o(n)就可以了，有兴趣可以看看具体数学的第一章，关于约瑟夫问题推导出了一系列的结论，很漂亮

3. 代码是给出了，但是解析的也太不清晰了吧！如 13 abejkcfghid jkebfghicda
第一步拆分为 三部分 (bejk, cfghi, d) * C(13,3)，为什么要这样拆分，原则是什么？