Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|

Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |

Language: Trigonometric optimization
Description Many problems arising in practical applications may be stated as Let’s consider a x) + F(_{2}y) + F(_{3}z) with constraint x + y + z = S, where x, y, z – variables, S – parameter, x, y, z, S – natural numbers excluding zero. Each of the functions F, _{1}F and _{2}F is a trigonometric function _{3} or sin.cosYou need to write a program which solves the Input The input contains 5 lines. The first line describes function sin or cos. The second and the third lines describe functions F and _{2}Frespectively and have the same format as the first line. Next, the fourth line contains either _{3} min or max. If the line contains min than it is necessary to minimize criterion function, otherwise it is necessary to maximize criterion function. Finally, the fifth line contains parameter S value (3 ≤ S ≤ Output The only line of the output contains one real number – the found value of the Sample Input sin cos sin max 10 Sample Output 2.7787651403 Hint Beware that GNU compilers for C and C++ provide relatively slow trigonometric functions. Source Northeastern Europe 2005, Western Subregion |

[Submit] [Go Back] [Status] [Discuss]

All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di

Any problem, Please Contact Administrator