103200: [Atcoder]ABC320 A - Leyland Number

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:7 Solved:0

Description

Score : $100$ points

Problem Statement

You are given positive integers $A$ and $B$.
Print the value $A^B+B^A$.

Constraints

  • $2 \leq A \leq B \leq 9$
  • All input values are integers.

Input

The input is given from Standard Input in the following format:

$A$ $B$

Output

Print the answer as an integer.


Sample Input 1

2 8

Sample Output 1

320

For $A = 2, B = 8$, we have $A^B = 256, B^A = 64$, so $A^B + B^A = 320$.


Sample Input 2

9 9

Sample Output 2

774840978

Sample Input 3

5 6

Sample Output 3

23401

Output

分数:100分

问题描述

给你两个正整数 $A$ 和 $B$。
输出 $A^B+B^A$ 的值。

约束条件

  • $2 \leq A \leq B \leq 9$
  • 所有的输入值都是整数。

输入

输入从标准输入以以下格式给出:

$A$ $B$

输出

将答案作为一个整数输出。


样例输入 1

2 8

样例输出 1

320

对于 $A = 2, B = 8$,我们有 $A^B = 256, B^A = 64$,所以 $A^B + B^A = 320$。


样例输入 2

9 9

样例输出 2

774840978

样例输入 3

5 6

样例输出 3

23401

HINT

输出$A^B+B^A$

加入题单

算法标签: