Extend the multi-user file system with updateCapacity(userId, newCapacity). If the user's current total file size exceeds the new capacity, delete files owned by that user until the total fits. Always remove the largest files first. If multiple files have the same size, remove the lexicographically smaller name first to make the result deterministic. updateCapacity returns the number of removed files, or None if the user does not exist. Also support addUser, addFileByUser, and listFiles(), where listFiles returns all remaining files formatted as 'name(size)' sorted by size descending, then name ascending. Return results for all operations in order.
Examples
Input: [("addUser", "u1", 15), ("addFileByUser", "u1", "a", 4), ("addFileByUser", "u1", "b", 6), ("addFileByUser", "u1", "c", 3), ("updateCapacity", "u1", 7), ("listFiles",)]
Expected Output: [True, True, True, True, 1, ['a(4)', 'c(3)']]
Explanation: Shrinking from total size 13 to capacity 7 removes the largest file b(6).
Input: [("addUser", "u1", 20), ("addUser", "u2", 10), ("addFileByUser", "u1", "aa", 5), ("addFileByUser", "u1", "ab", 5), ("addFileByUser", "u1", "c", 4), ("addFileByUser", "u2", "x", 7), ("updateCapacity", "u1", 4), ("listFiles",)]
Expected Output: [True, True, True, True, True, True, 2, ['x(7)', 'c(4)']]
Explanation: u1 must drop two size-5 files. The tie is broken by name, so aa is removed before ab.
Input: [("updateCapacity", "ghost", 5)]
Expected Output: [None]
Explanation: Edge case: updating a missing user returns None.
Input: [("addUser", "u1", 8), ("addFileByUser", "u1", "a", 3), ("addFileByUser", "u1", "b", 5), ("updateCapacity", "u1", 8), ("listFiles",)]
Expected Output: [True, True, True, 0, ['b(5)', 'a(3)']]
Explanation: If the user already fits in the new capacity, no files are removed.