#include using namespace std; class stac { private: int a, b, l, n, plot; public: stac() :a(0), b(0), l(0), plot(0) {} stac(int x, int y, int z) :a(x), b(y), l(z) {} ~stac() {} void operator ++(int) { cin >> n; int* M = new int[n]; for (int i = 0; i < n; i++) { cin >> a >> b >> l; M[i] = 0; Function(M,i); } for (int i = 0; i < n; i++) cout << M[i] << endl; delete[] M; } void Function(int* M, int i) { if (b > 1000) { while (b > 1000) { b = b - 1000; M[i]++; } } else M[i] = 0; if (M[i] > a) M[i] = a; } }; int main() { stac s; s++; }