Minhyuk wants to buy $N$ notebooks. He has already surveyed the notebook prices at $M$ online stores.
Store $i$ sells one notebook for $p_i$ won and has $s_i$ notebooks in stock. Placing an order with a store incurs a shipping fee of $o_i$ won, charged only once no matter how many notebooks you buy. You may not order more than the $s_i$ notebooks a store has in stock.
Write a program that computes the minimum cost of buying $N$ notebooks.
The first line contains the number of test cases $T$ ($T \le 100$). Each test case has the following format.
For each test case, print the minimum cost of buying $N$ notebooks on its own line.