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

Validate Exchange Lot Size Rules

An exchange accepts only positive order quantities that are multiples of a fixed lot size.

An exchange accepts only positive order quantities that are multiples of a fixed lot size. For each proposed quantity print VALID if it is positive and divisible by the lot size, otherwise INVALID.

Input format

First line: lotSize N. Next N lines: one proposed integer quantity.

Output format

Print VALID or INVALID for each quantity.

Examples

Example 1
Input
5 4
5
10
0
-5
Expected output
VALID
VALID
INVALID
INVALID

Constraints

  • 1 ≤ lotSize ≤ 10^9
  • 1 ≤ N ≤ 100000
  • -10^9 ≤ quantity ≤ 10^9

Related concepts

Risk Checks

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
5 4
5
10
0
-5
Expected output
VALID
VALID
INVALID
INVALID
Execution requires a secure external judge.