Submission #26142798


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a, b, c;
  cin >> a >> b >> c;
 
  int q = ((a-1)/c+1)*c;

  if ( q<=b ) {
    cout << q << endl;
  } else {
    cout << -1 << endl;
  }
}

Submission Info

Submission Time
Task A - Find Multiple
User RoadLynton27
Language C++ (GCC 9.2.1)
Score 100
Code Size 221 Byte
Status AC
Exec Time 7 ms
Memory 3624 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 2
AC × 10
Set Name Test Cases
Sample example0.txt, example1.txt
All 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, example0.txt, example1.txt
Case Name Status Exec Time Memory
000.txt AC 7 ms 3528 KiB
001.txt AC 2 ms 3568 KiB
002.txt AC 5 ms 3620 KiB
003.txt AC 2 ms 3596 KiB
004.txt AC 3 ms 3524 KiB
005.txt AC 2 ms 3592 KiB
006.txt AC 2 ms 3624 KiB
007.txt AC 2 ms 3404 KiB
example0.txt AC 2 ms 3592 KiB
example1.txt AC 2 ms 3624 KiB