1760 - I2P(I)2019_Yang_EECS_lab3 Scoreboard

Time

2019/10/01 18:30:00 2019/10/01 20:30:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
12384 One Digit Adding
12400 High Wage

12384 - One Digit Adding   

Description

小磚頭(Small Brick) is a boy who love to do addition.

However, he never understand why 1+1 equals to 2 but not 11,

why is 3+33+333 equals to 369 but not 333333.

 

Until one day he saw a man programming in Python.

The man type: '3'+'33'+'333', magically, the answer is '333333'!

This breaking news astonished 小磚頭(Small Brick).

He run excitedly back to home, and told you the news.

However, you know that the answer is exactly not 333333.

Can you help 小磚頭(Small Brick) to find the correct answer?

 

Given a digit number A, and a number K.

We defined that S1=A, S2=AA, S3=AAA... .

Please calculate S1 + S2 + .. + SK.

 

For Example: A=3, K=3

then the answer is 3 + 33 + 333=369.

 

ouo.

 

Hint1: you can use long long type to store output

Hint2: you can use %lld to print long long type

Input

Input contain only one line.

2 number A, K with a space between.

It is guarantee A is a digit number and 1 <= K <= 16.

Output

Output the answer with a new line character at the end.

Sample Input  Download

Sample Output  Download

Tags




Discuss




12400 - High Wage   

Description

Johnson is a rich worker in a factory.
His every minute wage is X TWD/min.

He even get a bonus pay of Y TWD per hour
He works from H1:M1:S1 to H2:M2:S2 everyday.
Your task is to calculate Johnson's working time and daily wage.

Example:
The Hourly wage is 5 TWD/min, and bonus pay is 50 TWD/hour. Johnson works from 8:00:00 to 20:30:59, then his working time is 12 hour 30 minutes 59 seconds, and daily wage is 12*60*5+30*5+12*50=4350 TWD.

Input

On the first line, two number X, Y, represented Johnson's minutely mage and bonus pay per hour.
On the second line, H1:M1:S1 ~ H2:M2:S2 represents the time John start/end working.

0 <= X <= 10000
0 <= H1, H2 <= 23
0 <= M1, M2, S1, S2 <= 59

It's guaranteed that H1:M1:S1 is earlier than H2:M2:S2

Output

Output Johnson's working time and daily wage.
The first line: "Working Time: A Hour(s) B Minute(s) C Second(s)".
The second line: "Daily Wage: D TWD".
A, B, C, D should be replaced by four numbers.

Please refer to the sample input/output for the precise format, and there is a '\n' at the end of each line.

Sample Input  Download

Sample Output  Download

Tags




Discuss