Tetration (Problem concept)

Revision en1, by Im9223372036854775808, 2025-12-02 11:33:04

Description

Tetration is a binary operator, defined as ʸx=xˣ(y times)ˣ. In other words, tetration is repeated exponentiation. In arrow notation it is defined as x^^y. Your goal is to count x^^y.

  • Input file contains two numbers x (1<=x<=1234), y (0<=y<=2)
  • Output contains one number y — answer.

Input, output

Example 1

Input

2 2

Output

4

Example 2

Input

5 0

Output

1

Example 3

Input

6 2

Output

46656

Soucre: Tetration

Tags problem, bignumber, long arithmetic

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
ru2 Russian Im9223372036854775808 2025-12-02 11:41:43 39
ru1 Russian Im9223372036854775808 2025-12-02 11:38:11 692 Первая редакция перевода на Русский
en1 English Im9223372036854775808 2025-12-02 11:33:04 662 Initial revision (published)