## Math Expression

Points:100 (partial)
Time limit:0.1s
C#0.1s
Java 91.0s
Memory limit:16M
C#32M
Java 932M
Author:

Tags
Math
Difficulty
Easy

You are given the following mathematical expression:

The sin(x) is a trigonometric function that returns the sine from the angle x (measured in radians).

The mod operator finds the remainder of division of one number by another.

Here are some examples for how the mod operator should work:

• 5 mod 2 = 1
• 5.99 mod 3 = 2
• 6 mod 3 = 0

Your task is to write a computer program that calculates the result from the shown mathematical expression, depending on the values of the variables N, M and P.

### Input

• Read from the standard input

• The input consists of exactly 3 lines. In each line you consequently enter the variables N, M and P.

• The separator between the integer and the fractional part of the number is “.” (dot).

• The number of digits that follow the decimal point will not be more than 6.

• The input data will always be valid and in the format described. There is no need to check it explicitly.

### Output

• Print to the standard output

• There must be only one line, showing the result from the mathematical expression.

• The result must show exactly 6 digits after the “.” (decimal point).

### Constraints

• The numbers N, M and P are fractional numbers.
• N, M and P will be between -10 000 000 and 10 000 000, inclusive.
• The numbers M and P will always have values other than 0
• It is guaranteed that none of the combinations of the numbers N, M and P will lead to dividing by zero.

### Sample tests

#### Input

1
2
3

#### Output

-2.570352

#### Input

0.1234
1.2345
2.3456

#### Output

-3.596568

#### Input

0.123456
1.234567
2.345678

#### Output

-3.596421

• ivan.kirov
commented on Oct. 30, 2018 edit 3

Тъй като я няма вече картинката с израза, търси се това:

(N*N + (1/M/P) + 1337)/(N - 128.523123123*P) + sin(M%180)

• plamen.hhh
commented on Sept. 12, 2018

На пръв поглед не е сложна, но не е и толкова лесна.

• iordanbalt
commented on April 11, 2018 edited

На втория example ми изкарва -3.493887 а трябва да е -3.596568 всички са ми double не мога да разбера сигурно има някаква тънкост

• jackojelev
commented on July 23, 2018

5.99 mod 3 = 2

Ето къде е ключът от палатката!

• stoyanoff.martin
commented on April 30, 2018

Откри ли проблема? И при мен се получава същото.

• georgievgeorgi
commented on March 24, 2018

Между другото тайм-лимитът за Java8 e останал 0,1 сек. За Java9 e OK

• markov.r
commented on Jan. 29, 2018

Да вдигнем малко тайм-лимита за Java?

• donchominkov
commented on Jan. 30, 2018

Spreading love for Java - Done ;)

• aleksandar_sb
commented on Jan. 26, 2018

The mathematical expression is a missing resource on GitHub...