You will write a C program according to the following description.
• The program reads real numbers from a file. Determines the chunks according to a criteria. For each chunk, the average of the numbers is calculated. Chunks are listed in ascending order based on their average.
• Input file contains a sequence of real numbers which are separated by whitespace. The whole sequence consists of chunks which are going to be separated by the following criteria:
– n is the number to be added and a is the average of the chunk. If n is added to the current chunk the average becomes b.
– n is going to be added to the chunk if the following condition is satisfied:
– !(b a*(1+p1) || b < a*(1-p1) || a n*p2 || a < n/p2)
– Beware, there is a ! at the beginning of the condition.
– Here, p1 and p2 are pre-defined variables. Declare them as constants in your program.
• Each line of the output file lists the numbers in chunks.
• Code it so that it reads a text file named input.txt and writes to a text file named output.txt. (If you don’t follow this convention your grade will be 0.0).