/************************************************************** User: error408 Language: C/C++ School: SSDUT Saying: Do one thing at a time,and do well. ****************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define clr(s,x) memset((s),(x),sizeof(s)) #define lson l,m,rt<<1 #define rson m+1,r,rt<<1|1 #define lowbit(x) (x&(-x)) #define PB push_back #define For(i,a,b) for(int i=a;i vint; typedef vector vstring; /************************************END DEFINE*********************************************/ const int maxn = 1e5 + 100; char s[maxn]; char t[maxn]; int k; int main() { int T,cas = 1; cin>>T; while(T--){ getchar(); gets(s); scanf("%d",&k); int len = strlen(s); int row = len/k; if(len%k)row++; int last = k-row*k+len; int cnt = 0; for(int i=0;i