A. AvtoBus

time limit per test

1 second

memory limit per test

256 megabytes

Spring has come, and the management of the AvtoBus bus fleet has given the order to replace winter tires with summer tires on all buses.

You own a small bus service business and you have just received an order to replace nn tires. You know that the bus fleet owns two types of buses: with two axles (these buses have 44 wheels) and with three axles (these buses have 66 wheels).

You don't know how many buses of which type the AvtoBus bus fleet owns, so you wonder how many buses the fleet might have. You have to determine the minimum and the maximum number of buses that can be in the fleet if you know that the total number of wheels for all buses is nn.

Input

The first line contains an integer tt (1≤t≤10001≤t≤1000) --- the number of test cases. The following lines contain description of test cases.

The only line of each test case contains one integer nn (1≤n≤10181≤n≤1018) --- the total number of wheels for all buses.

Output

For each test case print the answer in a single line using the following format.

Print two integers xx and yy (1≤x≤y1≤x≤y) --- the minimum and the maximum possible number of buses that can be in the bus fleet.

If there is no suitable number of buses for the given nn, print the number −1−1 as the answer.

Example

Input

Copy

复制代码

4

4

7

24

998244353998244352

Output

Copy

复制代码
1 1
-1
4 6
166374058999707392 249561088499561088

Note

In the first test case the total number of wheels is 44. It means that there is the only one bus with two axles in the bus fleet.

In the second test case it's easy to show that there is no suitable number of buses with 77 wheels in total.

In the third test case the total number of wheels is 2424. The following options are possible:

  • Four buses with three axles.
  • Three buses with two axles and two buses with three axles.
  • Six buses with two axles.

So the minimum number of buses is 44 and the maximum number of buses is 66.

解题说明:水题,首先需要保证n为偶数且要大于4,然后最小值是除以6,最大值除以4。

cpp 复制代码
#include <stdio.h>

int main() 
{
	int t;
	scanf("%d", &t);
	while (t--)
	{
		long long n;
		scanf("%lld", &n);
		if (n < 4 || n % 2 != 0) 
		{
			printf("-1\n");
		}
		else 
		{
			long long min = (n + 5) / 6;
			long long max = n / 4;
			printf("%lld %lld\n", min, max);
		}
	}
	return 0;
}
相关推荐
AI_Keymaker1 小时前
一句话生成3D世界:腾讯开源混元3D模型
算法
Leon_vibs1 小时前
当 think 遇上 tool:深入解析 Agent 的规划之道
算法
旧时光巷1 小时前
【机器学习-2】 | 决策树算法基础/信息熵
算法·决策树·机器学习·id3算法·信息熵·c4.5算法
落了一地秋1 小时前
4.5 优化器中常见的梯度下降算法
人工智能·算法·机器学习
前端伪大叔2 小时前
第 5 篇:策略参数怎么调优?Freqtrade hyperopt 快速入门
算法·代码规范
Code季风2 小时前
深入理解令牌桶算法:实现分布式系统高效限流的秘籍
java·算法·微服务
KyollBM2 小时前
【Luogu】每日一题——Day15. P1144 最短路计数 (记忆化搜索 + 图论 + 最短路)
算法·图论
一百天成为python专家2 小时前
K-近邻算法
数据结构·python·算法·pandas·近邻算法·ipython·python3.11
满分观察网友z2 小时前
告别烦人的“三连发”:我的智能评论系统过滤之旅(1957. 删除字符使字符串变好)
算法
满分观察网友z2 小时前
滑动窗口下的极限挑战:我在实时数据流中挖掘最大价值分(1695. 删除子数组的最大得分)
算法