AtCoder Beginner Contest 118
翻译中…
Problem Statement
翻译中…
You are given positive integers $A$ and $B$.
翻译中…
If $A$ is a divisor of $B$, print $A + B$; otherwise, print $B - A$.
翻译中…
Constraints
翻译中…
- All values in input are integers.
$1 \leq A \leq B \leq 20$
翻译中…
Input
翻译中…
Input is given from Standard Input in the following format:
翻译中…
A B
翻译中…
Output
翻译中…
If $A$ is a divisor of $B$, print $A + B$; otherwise, print $B - A$.
翻译中…
样例
Input #1
4 12
Output #1
16
As $4$ is a divisor of $12$, $4 + 12 = 16$ should be printed.
Input #2
8 20
Output #2
12
Input #3
1 1
Output #3
2
$1$ is a divisor of $1$.
题目信息
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。