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;
}
相关推荐
鑫鑫向栄17 分钟前
[蓝桥杯]最优包含
数据结构·c++·算法·职场和发展·蓝桥杯·深度优先
南玖yy19 分钟前
深入理解 x86 汇编中的重复前缀:REP、REPZ/REPE、REPNZ/REPNE(进阶详解版)
开发语言·网络·汇编·后端·算法·bochs
泛舟起晶浪19 分钟前
网络寻路--图论
c++·算法
hn小菜鸡1 小时前
LeetCode 3370.仅含置位位的最小整数
算法·leetcode
r0ysue_6 小时前
02.上帝之心算法用GPU计算提速50倍
算法·gpu
L_cl6 小时前
【Python 算法零基础 4.排序 ⑦ 桶排序】
数据结构·算法·排序算法
小O的算法实验室7 小时前
2025年AIR SCI1区TOP,多策略增强蜣螂算法MDBO+实际工程问题,深度解析+性能实测
算法·论文复现·智能算法·智能算法改进
花自向阳开10247 小时前
LeetCode hot100-11
数据结构·算法·leetcode
月亮被咬碎成星星8 小时前
LeetCode[404]左叶子之和
算法·leetcode
有梦想的骇客8 小时前
书籍在其他数都出现k次的数组中找到只出现一次的数(7)0603
算法