#include <bits/stdc++.h>

using namespace std;

const int INF = 0x3FFFFFFF;

int a[200010];

int main()
{
	ios::sync_with_stdio(false);
	int T, n, m;
	cin >> T;
	for (int cas = 1; cas <= T; cas++) {
		cin >> n >> m;
		for (int i = 0; i < m; i++) cin >> a[i];
		int len = n / m;
		sort(a, a + m);
		vector<int> Q;
		for (int i = 1; i < m; i++) {
			int delta = a[0] + len * i;
			Q.push_back(a[i] - delta);
		}
		sort(Q.begin(), Q.end());
		int c0 = Q.front(), c1 = Q.back();
		//cout << c0 << ' ' << c1 << endl;
		int dis = n >> 1;
		int ans = INF;
		for (int i = -dis + 1; i <= dis + 1; i++) {
			int delta = max(abs(i), abs(c0 + i));
			ans = min(ans, max(delta, abs(c1 + i)));
		}
		printf("Case #%d: %d\n", cas, ans);
		//break;
	}
	return 0;
}
