Welcome   HUNAN NORMAL UNIVERSITY ACM/ICPC Judge Online
Home
FAQs
Problem Set
Practices
Online Contests
Major Exercises
OI Special
Judgement
Submit
Online Status
User Ranklist
Users
Register new
Login
Web Links
Hunan Normal University
College of Information Science and Engineering
鸡兔同笼
Time Limit: 1000ms, Special Time Limit:2500ms, Memory Limit:32768KB
Total submit users: 77, Accepted users: 74
Problem 10860 : No special judgement
Problem description
  一个笼子里面关了鸡和兔子(鸡有2只脚,兔子有4只脚,没有例外)。已经知道了笼子里面脚的总数a,问笼子里面至少有多少只动物,至多有多少只动物

Input
  第1行是测试数据的组数n,后面跟着n行输入。每组测试数据占1行,包括一个正整数a (a < 32768)

Output
  n行,每行输出对应一个输入。输出是两个正整数,第一个是最少的动物数,第二个是最多的动物数,两个正整数用空格分开。如果没有满足要求的情况出现,则输出20

Sample Input
2
3
20
Sample Output
0 0
5 10
Problem Source
  qshj 

Submit   Discuss   Judge Status  Problems  Ranklist 

HUNAN NORMAL UNIVERSITY ACM/ICPC Judge Online, Version 2010.5.5.final.
Web visits:2078 today,16258805 total, since 2010-05-07