PivotOJ

Kinking Cables

시간 제한: 1000ms메모리 제한: 1024MB출처: BAPC 2021BOJ 23385

문제

You need to lay a cable to connect two computers with each other. This cable however has a very specific length and you need to use exactly the full length of the cable. Moreover, the cable cannot intersect itself and one part of the cable cannot be too close to another part. Can you connect the two computers with each other using the full length of the cable?

The two computers are standing in an n×mn \times m rectangular two-dimensional room. Computer 1 is always positioned at (0,0)(0,0) (the upper left corner) and Computer 2 at (n,m)(n,m) (the lower right corner). The cable is specified by a sequence of marked points p1,p2,,psp_1, p_2, \dots, p_s. The path of the cable is then obtained by connecting the consecutive points of this sequence with (straight) line segments. The cable path should satisfy the following constraints:

  • None of the line segments within the cable path should intersect.
  • The marked points of the path should not be too close to each other: given a point pip_{i} there should be no other marked points strictly within a radius of 1 of pip_{i}, except possibly pi1p_{i-1} and pi+1p_{i+1} (the two consecutive points).
  • The path should always start at (0,0)(0,0) and end at (n,m)(n,m).
  • All points should lie somewhere in the n×mn \times m room.

입력

The input consists of:

  • One line with two integers nn and mm (2n,m1002\leq n,m \leq 100), the width and height of the room.
  • One line with a floating-point number \ell (n2+m2nm\sqrt{n^2 + m^2} \le \ell \le n\cdot m), the length that the cable should have.

출력

Output the number of points kk (2k5002 \le k \le 500) that the cable path contains, followed by the kk points of the path, in their respective order. Each point consists of two floating-point numbers xx and yy (0x,y100)(0 \le x, y \le 100), the xx- and yy-coordinates of this point in the path.

The total length of the path should be exactly \ell, up to a relative or absolute error of 10610^{-6}.

If there are multiple valid solutions, you may output any one of them.

예제

예제 1

입력
3 4
5.0
출력
2
0 0
3 4

예제 2

입력
3 4
7.0
출력
3
0 0
3 0
3 4

예제 3

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