#K74837. Calculate Total Revenue
Calculate Total Revenue
Calculate Total Revenue
You are given a list of orders. Each order contains a number of product items. For each item, you are provided with its quantity and price. Your task is to compute the total revenue generated by all orders.
The input begins with an integer T, which denotes the number of orders. For each order, the first integer N indicates the number of items in that order, followed by N lines each containing two integers: the quantity and the price of an item.
The total revenue is defined as the sum of the product of quantity and price for every item in every order. Mathematically, if an order contains items \( (q_{1}, p_{1}), (q_{2}, p_{2}), \dots, (q_{N}, p_{N}) \), then the revenue for that order is:
\[ R = \sum_{i=1}^{N} q_{i} \times p_{i} \]
The overall revenue is the sum of revenues for all orders.
inputFormat
The first line contains an integer T representing the number of orders.
For each order, the first line contains an integer N indicating the number of items in that order.
Then, N lines follow, each containing two integers quantity and price separated by a space.
outputFormat
Output a single integer representing the total revenue generated from all orders.
## sample1
3
2 100
1 200
5 70
750
</p>