Part 1 — Versioned key-value store: Implement a data structure with set(key, value, t) and get_at(key, t) that returns the value for key whose timestamp is the greatest <= t (or None if none). Timestamps are integers and may arrive out of order. Optimize both time and space for up to 1e5 keys and 1e6 operations. Explain your data structures, complexity, and edge cases (duplicate timestamps per key, missing keys, very large t, memory). Provide working code for core methods. Part 2 — Type conversion planning: Given primitive types and directed conversion rules (from, to, cost), answer Q queries (source_type, target_type) by returning the minimum total cost to transform source to target, or -1 if impossible. Types <= 1e4, rules <= 1e5, queries <= 1e5. Explain algorithm choices (e.g., Dijkstra on demand vs preprocessing), complexity, path reconstruction, and how to handle dynamic updates to rules.