#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int c, T;
cin >> c >> T;
while(T--)
{
ll n, m, k;
cin >> n >> m >> k;
ll total_side = n * k;
ll t1 = (total_side + m - 1) / m;
ll ans = max(t1, k);
cout << ans << '\n';
}
return 0;
}