CF1679A.AvtoBus

入门

通过率:0%

时间限制:1.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

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.

春天到了,AvtoBus公交车队管理层已下令为所有公交车更换冬季轮胎为夏季轮胎。

你经营着一家小型公交服务公司,刚刚接到一项为 nn 个轮胎更换的任务。已知该公交车队拥有两种类型的公交车:双轴公交车(每辆有 44 个车轮)和三轴公交车(每辆有 66 个车轮)。

你并不知道 AvtoBus 公交车队中各类公交车的具体数量,因此你想知道车队可能拥有的公交车数量范围。已知所有公交车的车轮总数为 nn,请确定车队中公交车数量的最小值和最大值。

输入格式

The first line contains an integer tt (1≤t≤1 0001 \le t \le 1\,000) — 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 \le n \le 10^{18}) — the total number of wheels for all buses.

第一行包含一个整数 tt(1≤t≤1 0001 \le t \le 1\,000)——测试用例的数量。接下来的行包含各测试用例的描述。

每个测试用例仅一行,包含一个整数 nn(1≤n≤10181 \le n \le 10^{18})——所有公交车的车轮总数。

输出格式

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

Print two integers xx and yy (1≤x≤y1 \le x \le 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.

对于每个测试用例,请按以下格式在一行中输出答案。

输出两个整数 xx 和 yy(1≤x≤y1 \le x \le y)—— 分别表示公交车队中公交车数量的最小值和最大值。

如果对于给定的 nn 不存在满足条件的公交车数量,则输出数字 −1-1 作为答案。

输入输出样例

  • 输入#1

    4
    4
    7
    24
    998244353998244352

    输出#1

    1 1
    -1
    4 6
    166374058999707392 249561088499561088

说明/提示

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.

在第一个测试用例中,车轮总数为 44。这意味着车队中仅有一辆具有两个车轴的公交车。

在第二个测试用例中,容易证明:当车轮总数为 77 时,不存在满足条件的公交车数量。

在第三个测试用例中,车轮总数为 2424。以下方案均是可行的:

  • 四辆三车轴公交车;
  • 三辆两车轴公交车和两辆三车轴公交车;
  • 六辆两车轴公交车。

因此,公交车的最小数量为 44,最大数量为 66。

输入解题思路,AI测评打分。不知道怎么写?

首页