Amplitude Hackathon Winter '24 Problem 1 - Twila's Walk

View as PDF

Submit solution

Points: 3 (partial)
Time limit: 0.25s
Memory limit: 1G

Problem type

For those not in the know, Twila is one of the many #doggosofamplitude that you might see in a Dr. Pepper costume.

Jessica is taking Twila out for an afternoon walk! For today's walk, Jessica has planned a walk that is x miles long.

Twila prefers longer walks to shorter walks - when her walk is y miles long, she gains y2 units of happiness.

How many units of happiness will Twila gain on today's walk?

Constraints

1x10

Input Specification

The first and only line of input contains a positive integer x.

Output Specification

Output the number of units of happiness Twila gains on the walk.

Sample Input 1

Copy
1

Sample Output 1

Copy
1

Sample Explanation 1

If Twila walks for 1 mile, she gains 12=1 unit of happiness.

Sample Input 2

Copy
10

Sample Output 2

Copy
100

Sample Explanation 2

If Twila walks for 10 miles, she gains 102=100 units of happiness.


Comments

There are no comments at the moment.