Account
Draft saved on this device
▤ DescriptionOriginal CppValley problem
HFT SystemsEasy

Calculate Total Trade Notional

Calculate the total quantity × price across a stream of executed trades.

A trading feed sends executed trades as integer (quantity, price) pairs. Calculate the total notional value of the feed. This challenge tests reliable parsing and integer arithmetic. All quantities and prices are nonnegative.

Input format

First line: N, the number of trades. Next N lines: quantity price.

Output format

Print one integer: the sum of quantity × price for all trades.

Examples

Example 1
Input
3
2 100
1 90
3 110
Expected output
620

2×100 + 1×90 + 3×110 = 620.

Constraints

  • 0 ≤ N ≤ 100000
  • 0 ≤ quantity, price ≤ 100000
  • The answer fits into a signed 64-bit integer.

Related concepts

Market DataArithmeticParsing

This early-access exercise uses standard input/output. More advanced concurrency challenges will use specialized class interfaces, instrumentation, and stress tests once the judging infrastructure is ready.

⌘ CodeC++17
GNU C++17 · main.cpp

Loading Monaco C++ editor…

Checking judge...

Checking whether the external C++ judge is available.

⌁ Test cases & resultsPublic samples: 1
Input
3
2 100
1 90
3 110
Expected output
620
Execution requires a secure external judge.