The Troubles of Lmy

The Troubles of Lmy
Time Limit:1sMemory limit:32M
Accepted Submit:46Total Submit:126

Lmy is the lovely cousin of zmq, and she's a junior high school student. One day she came back from school.

Zmq: What did you learn in your class today?
Lmy: Similar triangle.
Zmq: Well, fine, have you mastered it?
Lmy: Sure, that's a piece of cake.
Zmq: OK, well, let me test you to see whether you have thoroughly understood the conception of being similar. I'll draw two Arbitrary Polygons, and you have to tell me whether they are similar or not. If you are right, I'll take you out.
Lmy: ......

It seems that little lmy got into troubles. Can you help her out by designing a program?

Input

There are several test cases in the input.

The first line of each case is an n (3 ≤ n ≤ 300), indicating that each polygon has n points. And in the following 2n lines, each line represents a point. The first n point represents the first polygon in anti-clockwise order, and so the second. Please note that all the polygons are simple. You can try to rotate them, then tell whether they are similar or not.

Output

For each case, output "Yes" or "No", showing whether they are similar.

Sample Input

3
0 0
1 1
0 1
0 0
2 2
0 2
3
0 0
1 1
0 1
0 0
2 2
0 1

Sample Output

Yes
No

http://acm.fzu.edu.cn/problem.php?pid=1785

 

求多边形相似的问题,如果对应的每一条边的倍数关系相同则相似

 

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值