public static void Main()
Console.WriteLine(getMoneySpent(keyboards, drives, budget));
Console.WriteLine(getMoneySpent(keyboards2, drives2, budget2));
static int getMoneySpent(int[] keyboards, int[] drives, int b) {
for(int i = keyboards.Length -1; i >= 0; i--)
for(int j = 0; j < drives.Length; j++)
if (keyboards[i] + drives[j] > b)
ans = Math.Max(ans, keyboards[i] + drives[j]);