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 y^2 units of happiness.

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

Constraints

1 \le x \le 10

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

1

Sample Output 1

1

Sample Explanation 1

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

Sample Input 2

10

Sample Output 2

100

Sample Explanation 2

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


Comments

There are no comments at the moment.