diff --git a/solutions/beecrowd/1099/1099.c b/solutions/beecrowd/1099/1099.c new file mode 100644 index 00000000..eeb6882c --- /dev/null +++ b/solutions/beecrowd/1099/1099.c @@ -0,0 +1,34 @@ +#include +#include + +int main() { + int32_t n, i, f, x, j, s; + + scanf("%d", &n); + + while (n--) { + s = 0; + + scanf("%d %d", &i, &f); + + if (i > f) { + x = i; + i = f; + f = x; + } + + i++; + + if (i % 2 == 0) { + i++; + } + + for (j = i; j < f; j += 2) { + s += j; + } + + printf("%d\n", s); + } + + return 0; +}