diff options
Diffstat (limited to 'tests/ii/arithmetic/reference.cc')
| -rw-r--r-- | tests/ii/arithmetic/reference.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ii/arithmetic/reference.cc b/tests/ii/arithmetic/reference.cc new file mode 100644 index 0000000..6d3d98f --- /dev/null +++ b/tests/ii/arithmetic/reference.cc @@ -0,0 +1,13 @@ +#include <cstdint> +#include <iostream> +int main() { + int count; + if (!(std::cin >> count)) return 1; + for (int i = 0; i < count; ++i) { + std::int64_t a, b; + if (!(std::cin >> a >> b) || b == 0) return 1; + auto small = a % 1000001; + std::cout << (a < b ? "TRUE" : "FALSE") << ':' << a / b << ':' << a % b + << ':' << small + b << ':' << small - b << ':' << small * b << '\n'; + } +} |
