若是凉夜已成梦

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


  • 运维

  • 前端

  • 编程

  • 随笔

  • hust-oj

1585: Bee Maja

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

题目描述

Maja is a bee. She lives in a hive of hexagonal honeycombs with thousands of other bees. But Maja has a problem. Her friend Willi told her where she can meet him, but Willi (a male drone) and Maja (a female worker) have different coordinate systems:

Willi's Coordinate System Willi (on right) is less intelligent, and just walks around cells in clockwise order starting from 1 in the middle of the hive.

Maja's system Willi's system

Help Maja to convert Willi's system to hers. Write a program which for a given honeycomb number returns the coordinates in Maja's system.

输入

The input file contains one or more integers each standing on its own line. All honeycomb numbers are less than 100,000.

输出

Output the corresponding Maja coordinates for Willi's numbers, with each coordinate pair on a separate line.

样例输入

1
2
3
4
5


样例输出

0 0
0 1
-1 1
-1 0
0 -1


参考代码

暂无

解析

暂无

hustoj

发表评论 取消回复

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

*
*


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

若是凉夜已成梦

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

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

友情链接

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