public static void Split(FriendsPresents presents, int n, int m) { operationsCount++; FriendsPresents frA = presents.Give(n, m); FriendsPresents frB = frA.CloneFriendA(); Share(frA, n - 1, 0); Share(frB, n - 1, 1); }
public static void Share(FriendsPresents presents, int n, int m) { if (n == 0) { presents.Give(n, m); var.Add(presents); return; } Split(presents, n, m); }