若是凉夜已成梦

青春里 总有些事情要努力去做 总有些梦想要拼命去追。


  • 运维

  • 前端

  • 编程

  • 随笔

  • hust-oj

1594: Birthday Cake

发表于 2017-10-06   |   分类于 HUSTOJ   |   阅读次数 1,159

题目描述

Lucy and Lily are twins. Today is their birthday, so Mother buys them a birthday cake. There are 2N cherries on the cake, where 1N50. Mother wants to cut the cake into two halves with a single straight-line cut through the center so each twin gets both the same amount of cake and the same number of cherries. Can you help her?

The cake has a radius of 100 and its center is located at (0, 0). The coordinates of each cherry are given by two integers (x, y). You must give the line in the form Ax + By = 0, where both A and B are integers in [- 500, 500]. Cherries are not allowed to lie on the cutline. There is at least one solution for each data set.

输入

The input file contains several test cases. The first line of each case contains the integer N. This is followed by 2N lines, where each line contains the (x, y) location of a cherry with one space between them. The input is ends with N = 0.

输出

For each test case, print a line containing A and B with a space between them. If there are many solutions, any one will suffice.

样例输入

2
-20 20
-30 20
-10 -50
10 -5
0

样例输出

0 1

参考代码

暂无

解析

暂无

hustoj

发表评论 取消回复

邮箱地址不会被公开。 必填项已用*标注

*
*


hoxis wechat
著作权归作者所有
站点更新说明
  • 文章目录
  • 站点概览
若是凉夜已成梦

若是凉夜已成梦

青春里 总有些事情要努力去做 总有些梦想要拼命去追。

1904 日志
6 分类
12 标签
RSS
weibo github twitter facebook

友情链接

Dreams孤独患者 Skip 原站点
© 2017 若是凉夜已成梦
Powered by WordPress | 已运行
Theme By NexT.Mist