308548: CF1537B. Bad Boy

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

Description

Bad Boy

题意翻译

Riley 不是一个好男孩,然而,他在悠悠球方面有着极高的造诣。他计划使用他的悠悠球技巧来烦一下他的朋友 Anton。 Anton 的房间可以被认为是一个 $n$ 行 $m$ 列的网格,于是令 $(i,j)$ 表示第 $i$ 行第 $j$ 列的格子。而 Anton 现在位于 $(i,j)$。 为了达成他的目的,Riley 会将**两个**悠悠球扔在格子上(可以是相同的格子)。 Anton 不喜欢悠悠球被扔在地上,于是他会去把两个悠悠球捡起来再返回到起始的格子上。他的路径是能够抵达两个悠悠球位置的最短路,同时这条最短路只有上下左右移动,而不包含斜向移动。 当然,他也不能穿墙,所以不能从第 $n$ 行向下走或之类的。 Riley 希望他的两个悠悠球可以使 Anton 的路径最长,你能帮帮他吗?

题目描述

Riley is a very bad boy, but at the same time, he is a yo-yo master. So, he decided to use his yo-yo skills to annoy his friend Anton. Anton's room can be represented as a grid with $ n $ rows and $ m $ columns. Let $ (i, j) $ denote the cell in row $ i $ and column $ j $ . Anton is currently standing at position $ (i, j) $ in his room. To annoy Anton, Riley decided to throw exactly two yo-yos in cells of the room (they can be in the same cell). Because Anton doesn't like yo-yos thrown on the floor, he has to pick up both of them and return back to the initial position. The distance travelled by Anton is the shortest path that goes through the positions of both yo-yos and returns back to $ (i, j) $ by travelling only to adjacent by side cells. That is, if he is in cell $ (x, y) $ then he can travel to the cells $ (x + 1, y) $ , $ (x - 1, y) $ , $ (x, y + 1) $ and $ (x, y - 1) $ in one step (if a cell with those coordinates exists). Riley is wondering where he should throw these two yo-yos so that the distance travelled by Anton is maximized. But because he is very busy, he asked you to tell him.

输入输出格式

输入格式


The first line contains a single integer $ t $ ( $ 1 \leq t \leq 10^4 $ ) — the number of test cases. Then $ t $ test cases follow. The only line of each test case contains four integers $ n $ , $ m $ , $ i $ , $ j $ ( $ 1 \leq n, m \leq 10^9 $ , $ 1\le i\le n $ , $ 1\le j\le m $ ) — the dimensions of the room, and the cell at which Anton is currently standing.

输出格式


For each test case, print four integers $ x_1 $ , $ y_1 $ , $ x_2 $ , $ y_2 $ ( $ 1 \leq x_1, x_2 \leq n $ , $ 1\le y_1, y_2\le m $ ) — the coordinates of where the two yo-yos should be thrown. They will be thrown at coordinates $ (x_1,y_1) $ and $ (x_2,y_2) $ . If there are multiple answers, you may print any.

输入输出样例

输入样例 #1

7
2 3 1 1
4 4 1 2
3 5 2 2
5 1 2 1
3 1 3 1
1 1 1 1
1000000000 1000000000 1000000000 50

输出样例 #1

1 2 2 3
4 1 4 4
3 1 1 5
5 1 1 1
1 1 2 1
1 1 1 1
50 1 1 1000000000

说明

Here is a visualization of the first test case. ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF1537B/55dd7a7a8828547b72bc3be325a8a8e51cf757fa.png)

Input

题意翻译

Riley 不是一个好男孩,然而,他在悠悠球方面有着极高的造诣。他计划使用他的悠悠球技巧来烦一下他的朋友 Anton。 Anton 的房间可以被认为是一个 $n$ 行 $m$ 列的网格,于是令 $(i,j)$ 表示第 $i$ 行第 $j$ 列的格子。而 Anton 现在位于 $(i,j)$。 为了达成他的目的,Riley 会将**两个**悠悠球扔在格子上(可以是相同的格子)。 Anton 不喜欢悠悠球被扔在地上,于是他会去把两个悠悠球捡起来再返回到起始的格子上。他的路径是能够抵达两个悠悠球位置的最短路,同时这条最短路只有上下左右移动,而不包含斜向移动。 当然,他也不能穿墙,所以不能从第 $n$ 行向下走或之类的。 Riley 希望他的两个悠悠球可以使 Anton 的路径最长,你能帮帮他吗?

加入题单

上一题 下一题 算法标签: