pascal developing

I want to develop a programwhich reads values and finds triplets in a signal is a triplet signal values ??with following properties: (a) the two extreme values ??are equidistant from the middle value, and (b) the two extreme values ??are equal and less than half the median price. The median value of a triplet gives the characteristic frequency equal to the median position in the signal. Thanks for you help.

Comments

: I want to develop a program: which reads values and finds triplets in a signal is a triplet : signal values ??with following properties: (a) the two extreme : values ??are equidistant from the middle value, and (b) the two : extreme values ??are equal and less than half the median price. The : median value of a triplet gives the characteristic frequency equal : to the median position in the signal. : Thanks for you help.: It is not clear what the requirement is. If the two extreme values are equal (specification b) then specification a is automatically satisfied.

Is this an electrical signal? If so then what do you mean by "price?"

Are the values real, integer or char?

Are the values sent three at a time? Or does each new value cause the oldest value to be discarded?

The median value of a triplet gives the characteristic frequencyequal to the median position in the signal.Atexample above, the frequency characteristic is 6 (because the5 median price is the sixth number displayed in the signal).Input files:The input files named seti.in are text files withstructure: They have exactly two lines. The first is an integernumber N (10 = N = 10.000), corresponding to the number of valuesthe signal we entered. The second line has Nintegers separated by two to one space.Output files:The output files named seti.out are text files withfollowing structure: The first line has an integer number K(0 = K = N). This number represents the number of charac-teristics frequencies identified. Follow K lineseach of which has an integer M, (2 = M = N-1).The number M is a characteristic frequency, namelyposition of the middle value of the corresponding triplet in the signal (thenumbering begins with 1). The characteristic frequencies shouldbe given in ascending order. If a frequency characteristicmatch more triplets, the frequency should beappears only once.I think I help you to help me if you have any question replyor if you can help me reply