zoukankan      html  css  js  c++  java
  • URAL 1963. Kite 几何水题

    1963. Kite

    Time limit: 1.0 second
    Memory limit: 64 MB
    Vova bought a kite construction kit in a market in Guangzhou. The next day the weather was good and he decided to make the kite and fly it. Manufacturing instructions, of course, were only in Chinese, so Vova decided that he can do without it. After a little tinkering, he constructed a kite in the form of a flat quadrangle and only needed to stick a tail to it.
    And then Vova had to think about that: to what point of the quadrangle's border should he stick the kite tail? Intuition told him that in order to make the kite fly steadily, its tail should lie on some axis of symmetry of the quadrangle. On the left you can see two figures of stable kites, and on the right you can see two figures of unstable kites.
    Problem illustration
    How many points on the quadrangle border are there such that if we stick a tail to them, we get a stable kite?

    Input

    The four lines contain the coordinates of the quadrangle's vertices in a circular order. All coordinates are integers, their absolute values don't exceed 1 000. No three consecutive quadrangle vertices lie on the same line. The opposite sides of the quadrangle do not intersect.

    Output

    Print the number of points on the quadrangle border where you can attach the kite.

    Samples

    inputoutput
    0 0
    1 2
    2 2
    2 1
    
    2
    
    0 0
    2 1
    2 2
    0 2
    
    0
    

    Hint

    The axis of symmetry of a flat figure is a straight line lying in the figure plane and dividing the figure to the two halves that are each other's mirror image.
    Problem Author: Alexander Ipatov
    Problem Source: Open Ural FU Personal Contest 2013
  • 相关阅读:
    大学该怎么度过
    MHA启动及关闭
    Qt多线程编程总结(二)——QMutex
    Qt多线程编程总结(一)(所有GUI对象都是线程不安全的)
    Qt中QFtp获取带有中文的文件名称出现乱码的解决方法(执行操作前就转换编码)
    QT实现拖放文件(有例子,并且图文并茂,非常清楚)
    QT5程序发布dll依赖
    通过Thrift访问HDFS分布式文件系统的性能瓶颈分析
    ExtJS面向对象
    Linq4j简明介绍
  • 原文地址:https://www.cnblogs.com/DreamHighWithMe/p/3366910.html
Copyright © 2011-2022 走看看