Solution to the problem number 474 of AceptaelReto - 474.

Any questions do not hesitate to contact.

#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n; scanf("%d",&n);
    while(n--)
    {
        int S,A,B,less=0; scanf("%d%d%d",&S,&A,&B);
        less = min(abs(S-A),abs(S-B)) + abs(A-B);
        printf("%d\n",less);
    }
    return 0;
}

Don't miss anything.

Keep in touch with Isaac Lozano Osorio!