Simulate a least-recently-used (LRU) cache with a fixed capacity processing
a sequence of operations:
PUT <key> <value> insert or update the key; both a PUT and a
successful GET make the key the most recently used;
when inserting a NEW key into a full cache, evict the
least recently used key first
GET <key> print the key's value, or -1 if absent (a miss does
not change the cache)
Input Format:
Line 1: capacity (positive integer)
Line 2: n (number of operations)
Lines 3 to n+2: one operation per line
Output Format:
One line per GET operation: the value found, or -1.