2396 - I2P(I)2021_Yang_lab2 Scoreboard

Time

2021/10/12 18:30:00 2021/10/12 20:30:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
13271 Linear Function
13293 hijklmnop

13271 - Linear Function   

Description

In this problem,  given a linear function in the form of

 ,

where ab and c are non-zero integers. You are asked to calculate f(x), or calculate the x by giving the f(x) as input.

Input

In the first line, there are three non-zero integers : a, b and c.

Next, there're two integers: d and e. If  d=0, print the answer of f(x) where x=e; otherwise, calculate the x value where f(x)=e.

All inputs are ranged in [0, 1000].

Output

Print one line which contains a floating point rounded to third decimal places.

Please print '\n' in the last line.

Sample Input  Download

Sample Output  Download

Tags




Discuss




13293 - hijklmnop   

Description

You are given the mapping between 1~9 and a set of 9 lowercase english letters.

Then, given a word consisting of characters from 1~9 and the given set of 9 lowercase english letters, try to tranform the word by the given mapping.

 

For example, in the sample input, you are given the string "hijklmnop".

This means the mapping:

1 <-> h, 2 <-> i, 3 <-> j, 4 <-> k, 5 <-> l, 6 <-> m, 7 <-> n, 8 <-> o, 9 <-> p.

Thus, the word "9881" should be transformed to "pooh", while the word "3p6n" should be transformed to "j9m7".

 

Note:

Testcases 1~2: only number to english letter.

Testcase 3: only english letter to number.

Testcases 4~5: no limit.

Input

Input contains two lines:

9 characters — the mapping between 1~9 and a set of 9 lowercase english letters. It's guaranteed that no same letters.

A 4-character word. It's guaranteed that the word contains only those characters from 1 to 9 and the lowercase english letters that appear in the first line of the input.

Output

Output contains only a line, that is, the word after being tranformed.

Sample Input  Download

Sample Output  Download

Tags




Discuss