Back
Close

Amicable numbers

Statement

 Goal

Given 2 integers a,b output if they are amicable numbers.

Two numbers are amicable if the sum of divisors of one number are equal to the other number.

For example:
number 220 has divisors 1, 2, 4, 5, 10, 11, 20, 22, 44, 55, 110 which sum up to 284
number 284 has divisors 1, 2, 4, 71, 142 which sum up to 220

Therefore numbers 220 and 284 are amicable numbers
Input
Line 1: Integers a and b separated by a space
Output
Line 1: Amicable if they are amicable, Not amicable if they are not
Constraints
0 <= a < 100000
0 <= b < 100000
Example
Input
220 284
Output
Amicable

Game modes
Fastest, Shortest

Test cases
Test 1 Test
Input
220 284
Output
Amicable

Validator 1 Validator
Input
220 284
Output
Amicable

Test 2 Test
Input
2620 2924
Output
Amicable

Validator 2 Validator
Input
2620 2924
Output
Amicable

Test 3 Test
Input
63020 76084
Output
Amicable

Validator 3 Validator
Input
63020 76084
Output
Amicable

Test 4 Test
Input
25 25
Output
Not amicable

Validator 4 Validator
Input
150 65666
Output
Not amicable

Solution language

Solution

Stub generator input