Author: | A. Klenin | Time limit: | 1 sec | |
Input file: | input.txt | Memory limit: | 256 Mb | |
Output file: | output.txt |
An expression for a function is composed of single-digit numbers, variable x, signs + and * , and zero or one calls to function sin. More formally:
Function f(x) has period p if f(x + p) = f(x) for all x.
Your program must, given an expression with no more than one call to sin, determine the minimal period of a function.
The input file contains a single string — expression.
Output file must contain single a floating point number — period with relative error not greater than 10 − 6. If a function is constant or aperiodic, output number 0.
Expression length is between 1 and 25 characters. There are no spaces in expression.
No. | Input file (input.txt ) |
Output file (output.txt ) |
---|---|---|
1 |
|
|
2 |
|
|
3 |
|
|