Problem B

Statement
Copy Copied
Description:
Kiana thinks two integers are friends if and only if one of them divides the other one. For example, 12 and 4 are friends, also 6 and 6 are friends too, but 120 and 36 are not.

A group of non-zero integers is called friendly, if each pair of its integers form a friend pair.

You are given a group of non-zero integers. See if they're friendly.

Input Format:
The first line contains n (1 ≤ n ≤ 1000), where n — the number of integers in the group.

The next line contains the elements, sorted in the non-decreasing order. The numbers are comma separated, they have at most 7 digits in their decimal notation and do not have any leading zeros.

Output Format:
If the group is friendly write "FRIENDS", else write "NOT FRIENDS".

Note:
None

Evaluations

Eval IDRun IDProviderModelLangSuccessTimestampPromptResponseStdoutStderrRetry
2716 20260317-000009 openai gpt-5.4 go true 2026-03-17T00:07:09.792215Z View View View View Retry
2133 20260311-031318 openai gpt-5.4 go true 2026-03-11T03:24:12.367182Z View View View View Retry