F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

The troubles of lmy

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 857    Accepted Submission(s): 293


Problem Description
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 (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
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-22 11:10:17, Gzip enabled