cswork / OAOpen practice workspace

Goldman SachsOA #9

Encryption Validity

Estimated MediumJudge-ready

Topics (AI-labelled)Bits & MathHashing

Given a test rate, a validity period in seconds, and a list of positive integer keys. The divisibility of a key is the number of elements in the list that are greater than 1 and divide it (duplicate elements count once per occurrence). The encryption strength is the maximum divisibility multiplied by 100000.

Input

The first line contains instructionCount validityPeriod n; the second line contains n values keys[i]. Based on the original constraints, this site adds n≥1; the other ranges follow the original problem: the rate and the validity period are 1..10^8, and keys are 1..10^5.

Output

Output two integers: whether the encryption can be broken within the validity period (1 if instructionCount×validityPeriod≥strength, otherwise 0), and the encryption strength.

Example 1

Input:

1000 10000 4
2 4 8 2

Output:

1 400000

Example 2

Input:

1 1 1
1

Output:

1 0

Example 3

Input:

100 1000 3
2 3 6

Output:

0 300000

Editorial

Loading solution…