Submit solution

Points:
7 (partial)

Time limit:
0.6s

Memory limit:
64M

Author:

Problem type

Allowed languages

Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, ~~CommonLisp~~, D, Dart, F#, Forth, Fortran, Go, ~~Groovy~~, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, ~~Nim~~, ~~ObjC~~, OCaml, ~~Octave~~, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig

There are many magical functions in the beautiful world of Mathematics and Computer Science. A magical function is defined as , for all , . It is known that .

is defined as the greatest integer that is less than or equal to .

Given the constants , , , , , and some non-negative integer , find the value of modulo .

#### Input Specification

On the first and only line of input, are given, separated by a single space.

are all **integers**.

#### Output Specification

Output .

#### Constraints

For all cases, , and .

#### Subtasks

##### Subtask 1 [10%]

##### Subtask 2 [30%]

##### Subtask 3 [60%]

#### Sample Input

`1 2 3 4 5 6`

#### Sample Output

`95`

## Comments

This comment is hidden due to too much negative feedback. Click here to view it.

This comment is hidden due to too much negative feedback. Click here to view it.