-->
当前位置:首页 > 题库

PROGRAMMING:Chicken and rabbit in the same cage

Luz5年前 (2021-05-10)题库457
A cage contains chicken and rabbit (chicken has two feet, rabbit has four feet, no exception). Having known the total number of feet in the cage, a, how many animals are there at least and at most in the cage
###Input format:
The first line is the number of test data groups n, followed by N lines of input. Each group of test data occupies 1 line, including a positive integer a (a < 32768).
###Output format:
N lines, each line of output corresponds to an input. Output is two positive integers, the first is the minimum number of animals, the second is the maximum number of animals, two positive integers separated by spaces. If the requirement is not met, two zeros will be output.
###Input example:
Here is a set of inputs. For example:
```in
two
three
twenty
```
###Output example:
The corresponding output is given here. For example:
```out
0 0
5 10
```







answer:If there is no answer, please comment