Week 1. H - Автопробег

mail@pastecode.io avatar
unknown
c_cpp
8 months ago
317 B
11
Indexable
Never
#include <iostream>

using namespace std;

int main() {
    int n, m;
    cin >> n >> m;
    cout << (m + n - 1) / n;
    return 0;
}

/*
n = 3  m = 6

(m + n - 1) / n

((6 + 0) + 3 - 1) / 3 = 2

n = 3  m = 7
((6 + 1) + 3 - 1) / 3 = 3

n = 3  m = 8
((6 + 2) + 3 - 1) / 3 = 3

n = 3 m = 9
((9 + 0) + 3 - 1) / 3 = 3
*/