int main()
{
    int t;
    long a,b;
    long long ans;
    scanf("%d",&t);
    while(t--)
    {
        scanf("%ld %ld",&a,&b);
        ans = ((b/10-a/10)*45) + D(a) + sumd(b-(b%10),b) - sumd((a-(a%10)),a);
        printf("%lld\n",ans);
    }
    return 0;
}
Esempio n. 2
0
File: misc.c Progetto: evanlev/cpd
/* dst[i] = src[i]/sumd(src) */
double normalize( const long N, double *dst, const double *src){
    double tot = sumd(N, src);
    if( tot > 0 ){
        smpy(N, 1.0/tot, dst, src);
        return tot;
    }else{
        return 0;
    }

}