PivotOJ

Avoiding the Abyss

시간 제한: 1000ms메모리 제한: 1024MB출처: NCPC 2024BOJ 32549

문제

You are standing on a point with integer coordinates (xs,ys)(x_s, y_s). You want to walk to the point with integer coordinates (xt,yt)(x_t, y_t). To do this, you can walk along a sequence of line segments. But there is a swimming pool in your way. The swimming pool is an axis aligned rectangle whose lower left corner is on the point (xl,yl)(x_l, y_l) and the upper right corner is on the point (xr,yr)(x_r, y_r). You cannot ever cross the swimming pool, not even on the border. However, it is dark and you do not know the coordinates (xl,yl)(x_l, y_l) and (xr,yr)(x_r, y_r). Instead, you threw a rock into the pool which revealed that the point (xp,yp)(x_p, y_p) is in the pool (or on the boundary).

Find a way to walk from the start to the end point along a sequence of line segments, so that you never cross the swimming pool.

입력

The first line contains two integers xsx_s and ysy_s (104xs,ys104-10^4 \leq x_s, y_s \leq 10^4).

The second line contains two integers xtx_t and yty_t (104xt,yt104-10^4 \leq x_t, y_t \leq 10^4).

The third line contains two integers xpx_p and ypy_p (104xp,yp104-10^4 \leq x_p, y_p \leq 10^4).

The problem is not adaptive, i.e. for every test case there exist four integers xl,yl,xr,yrx_l, y_l, x_r, y_r (104xl<xr104-10^4 \leq x_l < x_r \leq 10^4, 104yl<yr104-10^4 \leq y_l < y_r \leq 10^4) that constitute a swimming pool. The start and end points are always strictly outside the swimming pool, and the point (xp,yp)(x_p,y_p) is inside (or on the border). The start and end points are always distinct.

출력

First, print one integer NN (0N100 \leq N \leq 10), the number of points in between the start and end point that you want to visit. Then, print NN lines, the iith containing two integers xi,yix_i, y_i. These coordinates must satisfy 109xi,yi109-10^9 \leq x_i, y_i \leq 10^9. Note that these are not the same bounds than on the other coordinates.

This means that you will walk along straight line segments between (xs,ys),(x1,y1),,(xN,yN),(xt,yt)(x_s, y_s), (x_1, y_1), \dots, (x_N, y_N), (x_t, y_t) such that none of the line segments touch the swimming pool. It can be proven that a solution always exists.

예제

예제 1

입력
0 0
4 4
2 2
출력
2
0 3
1 4
이 문제는 채점 준비 중입니다. 테스트 데이터가 확보되면 제출이 가능합니다.