My issue
i can understand the problem .Can you explain the logic of this code.
cout << ceil(a / 5.0) - ceil(b / 5.0) << “\n”;
My code
#include <iostream>
#include <cmath>
using namespace std;
int main() {
int t, a, b;
cin >> t;
for (int i = 1; i <= t; i++) {
cin >> a >> b;
cout << ceil(a / 5.0) - ceil(b / 5.0) << "\n";
}
return 0;
}
Learning course: Complete C++ course
Problem Link: CodeChef: Practical coding for everyone