CF2171A.Shizuku Hoshikawa and Farm Legs
入门
通过率:0%
时间限制:1.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Nothing's ever been the same since... that summer with her.
— Shizuku Hoshikawa
Kaori wants to spend the day with Shizuku! However, the zoo is closed, so they are visiting Farmer John's farm instead.
At Farmer John's farm, Shizuku counts n legs. It is known that only chickens and cows live on the farm; a chicken has 2 legs, while a cow has 4.
Count how many different configurations of Farmer John's farm are possible. Two configurations are considered different if they contain either a different number of chickens, a different number of cows, or both.
Note that Farmer John's farm may contain zero chickens or zero cows.
自从……那个与她共度的夏天之后,一切都不一样了。
——星川紫月
薰想要和紫月一起度过这一天!然而动物园关门了,于是她们转而前往约翰农夫的农场参观。
在约翰农夫的农场里,紫月数到了 n 条腿。已知 农场里只生活着鸡和牛;一只鸡有 2 条腿,一头牛有 4 条腿。
请计算约翰农夫的农场可能有多少种不同的配置方式。若两种配置中鸡的数量不同、牛的数量不同,或两者均不同,则认为它们是不同的配置。
注意:约翰农夫的农场中可以没有鸡,也可以没有牛。
输入格式
The first line contains a single integer t (1≤t≤100) — the number of test cases.
The only line of each test case contains a single integer n (1≤n≤100).
第一行包含一个整数 t(1≤t≤100)—— 测试用例的数量。
每个测试用例仅有一行,包含一个整数 n(1≤n≤100)。
输出格式
For each test case, output a single integer, the number of different configurations of Farmer John's farm that are possible.
对于每个测试用例,输出一个整数,表示约翰农场的不同配置方案总数。
输入输出样例
输入#1
5 2 3 4 6 100
输出#1
1 0 2 2 26
说明/提示
For n=4, there are two possible configurations of Farmer John's farm:
- he can have two chickens and zero cows, or
- he can have zero chickens and one cow.
It can be shown that these are the only possible configurations of Farmer John's farm.
For n=3, it can be shown that there are no possible configurations of Farmer John's farm.
当 n=4 时,农夫约翰的农场有两种可能的配置:
- 他可以养两只鸡、零头牛,或者
- 他可以养零只鸡、一头牛。
可以证明,这些是农夫约翰的农场仅有的可能配置。
当 n=3 时,可以证明农夫约翰的农场不存在任何可能的配置。
输入解题思路,AI测评打分。不知道怎么写?