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;
}
相关推荐
workflower2 小时前
单元测试-例子
java·开发语言·算法·django·个人开发·结对编程
MicroTech20254 小时前
微算法科技(MLGO)研发突破性低复杂度CFG算法,成功缓解边缘分裂学习中的掉队者问题
科技·学习·算法
墨染点香4 小时前
LeetCode 刷题【126. 单词接龙 II】
算法·leetcode·职场和发展
aloha_7895 小时前
力扣hot100做题整理91-100
数据结构·算法·leetcode
Tiny番茄5 小时前
31.下一个排列
数据结构·python·算法·leetcode
挂科是不可能出现的5 小时前
最长连续序列
数据结构·c++·算法
前端小L6 小时前
动态规划的“数学之魂”:从DP推演到质因数分解——巧解「只有两个键的键盘」
算法·动态规划
RTC老炮6 小时前
webrtc弱网-ReceiveSideCongestionController类源码分析及算法原理
网络·算法·webrtc
21号 16 小时前
9.Redis 集群(重在理解)
数据库·redis·算法
hadage2338 小时前
--- 数据结构 AVL树 ---
数据结构·算法