import std.algorithm;
import std.conv;
import std.range;
import std.stdio;
import std.string;

void main ()
{
	auto tests = readln.strip.to !(int);
	foreach (test; 0..tests)
	{
		auto n = readln.strip.to !(int);
		auto a = readln.splitter.map !(to !(long)).array;
		auto m = a.maxElement * (n - 1L);
		auto t = a.sum (0L);
		auto s = max (m, t);
		s += ((n - 1) - (s % (n - 1))) % (n - 1);
		writeln (s - t);
	}
}
