#include using namespace std; using ll = long long; using P = pair; #define rep(i, n) for(ll i = 0; i < n; i++) #define all(x) (x).begin(),(x).end() templatebool chmin(T&a, const T&b){if(a>b){a=b;return 1;}return 0;} templatebool chmax(T&a, const T&b){if(a> t; rep(houren,t){ ll a,b,c; cin >> a >> b >> c; cout << a * mpow(10, c-1, b) % b * 10 / b << endl; } return 0; }