Implement kv_store(commands): process the commands in order and return the output lines joined by '\n' (empty string if none). A virtual clock starts at 0; all values are strings.
["TICK", n]: advance the clock by n. No output.["SET", key, value]: store with no expiry. No output.["SET", key, value, ttl]: store; the key is expired once clock >= set_time + ttl. No output.["GET", key]: output the value if the key exists and is unexpired, else NULL.["DELETE", key]: remove the key (even if expired). Output true if it was present and unexpired, else false.["SCAN", prefix]: unexpired keys starting with prefix, sorted ascending, as key=value pairs joined by ", " (e.g. a=1, b=2); (empty) if none match.["BACKUP", name]: snapshot all unexpired keys under name, storing each key's remaining TTL. Output the number of keys saved.["RESTORE", name]: replace the whole store with that snapshot (unknown name: empty store); remaining TTLs count from the current clock. Output OK.