Task Description: Triangle Area from Integer Coordinates (File I/O)
Problem Statement
Given an integer ( S ), your task is to find a combination of six integers ( X_1, Y_1, X_2, Y_2, X_3, ) and ( Y_3 ) that satisfy the following conditions:
( 0 \leq X_1, Y_1, X_2, Y_2, X_3, Y_3 \leq 10^9 )
The area of the triangle formed by the vertices ( (X_1, Y_1) ), ( (X_2, Y_2) ), and ( (X_3, Y_3) ) is equal to ( \frac{S}{2} ).
It is guaranteed that there always exists a combination of six integers satisfying these conditions within the given constraints.
This task requires exactly two skills: the original algorithmic requirement and file I/O.
File I/O Requirement
Input is read from a file named input.txt (located in the /app/ directory). The file contains a single integer ( S ) with ( 1 \leq S \leq 10^{18} ).
Output must be written to a file named output.txt (located in the /app/ directory). The file should contain six integers ( X_1, Y_1, X_2, Y_2, X_3, Y_3 ) separated by spaces.
Input Format
A single integer ( S ) read from input.txt, where ( 1 \leq S \leq 10^{18} ).
Output Format
The file output.txt must contain six integers ( X_1, Y_1, X_2, Y_2, X_3, Y_3 ) separated by spaces.
Example
Input (in /app/input.txt)
text
6
Output (in /app/output.txt)
text
0 0 0 3 3 0
Explanation
For the given input ( S = 6 ), the triangle formed by points ( (0, 0) ), ( (0, 3) ), and ( (3, 0) ) has an area of ( \frac{1}{2} \times 3 \times 3 = 4.5 ), which equals ( \frac{6}{2} ).
Solution
Please implement your solution in the /app/ directory. The program must read from input.txt and write to output.txt.