#include <stdio.h> #define ll long long int main() { ll n, m, k, i, j, c; if (scanf("%lld %lld", &n, &m) != EOF) { ll p[m]; for(i = 0; i < m; i++) { p[i] = 0; } for(i = 0; i < n; i++) { if(scanf("%lld %lld", &k, &c) != EOF) { // printf("k is %d c is %d\n", k, c); for(j = 0; j < k - 1; j++) { ll who; if(scanf("%lld", &who) != EOF) { // printf("participater %d need pay k/c = %d\n", who - 1, c/k); ll b = c/k; if(c % k != 0) b++; p[who - 1] += b; } else printf("error3\n"); } }else printf("error2\n"); } for(i = 0; i < m; i++) { printf("%lld ", p[i]); } } else printf("error1\n"); return 0; }