#C1525. Taco Inventory Query

    ID: 44740 Type: Default 1000ms 256MiB

Taco Inventory Query

Taco Inventory Query

You are given an inventory containing N items. Each item is represented by a unique identifier (a string) and an integer weight. You are also given Q queries. For each query, output the weight of the queried item if it exists in the inventory; otherwise, print "Item not found".

Mathematical Formulation:

Let \(N\) and \(Q\) be positive integers, and let the inventory be represented as a set of pairs \((s_i, w_i)\) for \(i=1,2,\dots,N\), where \(s_i\) is a unique identifier, and \(w_i\) is its weight. For each query string \(q\), output \(w_i\) if there exists an \(s_i = q\); otherwise, output \(\text{Item not found}\).

inputFormat

The first line of input contains two space-separated integers \(N\) and \(Q\). The following \(N\) lines each contain a string and an integer separated by a space, representing the unique identifier and the weight of an item. The next \(Q\) lines each contain a query string.

outputFormat

Output \(Q\) lines. For each query, output the weight of the item if it exists in the inventory; otherwise, output "Item not found".

## sample
5 3
item1 100
item2 200
item3 300
item4 400
item5 500
item3
item6
item1
300

Item not found 100

</p>