All problems

Problem 770

Square and Cube

Easy · 10 pts · Math, Basics

Problem

Read an integer N and print its square N × N and its cube N × N × N. The square of a negative number is positive, but its cube stays negative. For |N| up to 10^5 the cube can reach 10^15, which needs a 64-bit integer type in languages like C++ and Java.

Input

A single integer N.

Output

Print N² and N³ separated by a space.

Constraints

-10^5 <= N <= 10^5

Example input

-3

Example output

9 -27

Explanation

For N = -3 the square is (-3) × (-3) = 9 and the cube is 9 × (-3) = -27, so the answer is 9 -27.

Every problem here can be used in a RelayTrixCode team match. Create a room.

Previous: Rectangle Area and Perimeter Next: Sum of Even Numbers up to N