309440: CF1679A. AvtoBus

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

AvtoBus

题意翻译

### 题目描述 春天来了,车队的巴士需要更换轮胎。 轮胎有 $n$ 个,巴士有两种,第一种有4个轮子,第二种有6个。 求车队最多和最少有几辆巴士。 ### 输入格式 第一行一个整数 $t$,表示测试数据的数量。 接下来 $t$ 行,每行一个整数 $n$,表示轮胎的总数。 ### 输出格式 共 $t$ 行,每行两个整数,分别表示巴士数量的最小值和最大值。 若无解,输出 $-1$ 。

题目描述

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 $ n $ tires. You know that the bus fleet owns two types of buses: with two axles (these buses have $ 4 $ wheels) and with three axles (these buses have $ 6 $ 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 $ n $ .

输入输出格式

输入格式


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

输出格式


For each test case print the answer in a single line using the following format. Print two integers $ x $ and $ y $ ( $ 1 \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 $ n $ , print the number $ -1 $ as the answer.

输入输出样例

输入样例 #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 $ 4 $ . 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 $ 7 $ wheels in total. In the third test case the total number of wheels is $ 24 $ . 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 $ 4 $ and the maximum number of buses is $ 6 $ .

Input

题意翻译

### 题目描述 春天来了,车队的巴士需要更换轮胎。 轮胎有 $n$ 个,巴士有两种,第一种有 $4$ 个轮子,第二种有 $6$ 个。 求车队最少和最多有几辆巴士。 ### 输入格式 第一行一个整数 $t$,表示测试数据的数量。 接下来 $t$ 行,每行一个整数 $n$,表示轮胎的总数。 ### 输出格式 共 $t$ 行,每行两个整数,分别表示巴士数量的最小值和最大值。 若无解,输出 $-1$。

Output

**题目大意:**

春天来临,需要将车队的所有巴士更换为夏季轮胎。车队有两种巴士:两轴巴士(4个轮子)和三轴巴士(6个轮子)。给定轮胎总数\( n \),求车队的巴士数量的最小值和最大值。如果没有合适的巴士数量,则输出-1。

**输入格式:**

第一行包含一个整数\( t \)(\( 1 \le t \le 1,000 \)),表示测试数据的数量。接下来\( t \)行,每行包含一个整数\( n \)(\( 1 \le n \le 10^{18} \)),表示所有巴士的轮胎总数。

**输出格式:**

对于每个测试案例,输出一行包含两个整数\( x \)和\( y \)(\( 1 \le x \le y \)),分别表示车队的巴士数量的最小值和最大值。如果没有合适的巴士数量,输出-1。

**输入输出样例:**

**输入样例 #1:**
```
4
4
7
24
998244353998244352
```

**输出样例 #1:**
```
1 1
-1
4 6
166374058999707392 249561088499561088
```

**说明:**

- 在第一个测试案例中,总轮胎数为4,表示车队中只有一辆两轴巴士。
- 在第二个测试案例中,容易证明总轮胎数为7时没有合适的巴士数量。
- 在第三个测试案例中,总轮胎数为24,可能的情况有:
- 四辆三轴巴士。
- 三辆两轴巴士和两辆三轴巴士。
- 六辆两轴巴士。
所以巴士的最小数量是4,最大数量是6。**题目大意:** 春天来临,需要将车队的所有巴士更换为夏季轮胎。车队有两种巴士:两轴巴士(4个轮子)和三轴巴士(6个轮子)。给定轮胎总数\( n \),求车队的巴士数量的最小值和最大值。如果没有合适的巴士数量,则输出-1。 **输入格式:** 第一行包含一个整数\( t \)(\( 1 \le t \le 1,000 \)),表示测试数据的数量。接下来\( t \)行,每行包含一个整数\( n \)(\( 1 \le n \le 10^{18} \)),表示所有巴士的轮胎总数。 **输出格式:** 对于每个测试案例,输出一行包含两个整数\( x \)和\( y \)(\( 1 \le x \le y \)),分别表示车队的巴士数量的最小值和最大值。如果没有合适的巴士数量,输出-1。 **输入输出样例:** **输入样例 #1:** ``` 4 4 7 24 998244353998244352 ``` **输出样例 #1:** ``` 1 1 -1 4 6 166374058999707392 249561088499561088 ``` **说明:** - 在第一个测试案例中,总轮胎数为4,表示车队中只有一辆两轴巴士。 - 在第二个测试案例中,容易证明总轮胎数为7时没有合适的巴士数量。 - 在第三个测试案例中,总轮胎数为24,可能的情况有: - 四辆三轴巴士。 - 三辆两轴巴士和两辆三轴巴士。 - 六辆两轴巴士。 所以巴士的最小数量是4,最大数量是6。

加入题单

算法标签: