#include using namespace std; using Int=long long; using Real=long double; templateinline bool chmin(T&A,S B){return(A>B?A=B,1:0);} templateinline bool chmax(T&A,S B){return(A>A>>B>>C>>D>>E; REP(i,A*(B-C)) { ans+=D; if((i+2)%10==0&&E<=D)D-=E; } cout<>T; while(T--)sol(); }