#include <algorithm>
#include <cstdio>
#include <cstring>
using namespace std;
int presum(int x)
{
    return (x >> 1) - x * (x & 1);
}
int main()
{
    int q, l, r;
    scanf("%d", &q);
    while (q--)
    {
        scanf("%d%d", &l, &r);
        printf("%d\n", presum(r) - presum(l - 1));
    }
    return 0;
}