#include <cstdio>
#include <queue>
#include <cstring>
#include <algorithm>
using i64 = long long;
const int N = 1e5 + 5;
int n, x, k;
int a[N], dis[N];
void bfs(int s){
memset(dis + 1, 0x3f, sizeof(int) * (n));
std::queue<int> q;
q.push(s);
while (!q.empty()) {
int u = q.front(); q.pop();
for (int i = 1; i <= k; i++) {
int v = (u - a[i] + n) % n;
if (dis[v] == 0x3f3f3f3f) {
dis[v] = dis[u] + 1;
q.push(v);
}
}
}
}
int main(){
scanf("%d %d %d", &n, &x, &k);
for (int i = 1; i <= k; i++) {
scanf("%d", a + i);
}
bfs(0);
i64 p = dis[x], q = 1;
std::sort(dis + 1, dis + n + 1);
i64 sum = 0;
for (int i = 0; i < n; i++) {
if (dis[i] == 0x3f3f3f3f) {
break;
}
sum += dis[i];
i64 np = n + sum, nq = i + 1;
if (q * np < p * nq) {
p = np, q = nq;
}
}
i64 g = std::__gcd(p, q);
printf("%lld %lld\n", p / g, q / g);
return 0;
}