Skip to content

Instantly share code, notes, and snippets.

@joffilyfe
Created January 18, 2015 16:48
Show Gist options
  • Save joffilyfe/3bbc5f4fe05709c54ab5 to your computer and use it in GitHub Desktop.
Save joffilyfe/3bbc5f4fe05709c54ab5 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main(void) {
int x, y, sum, i, entrada, j, k;
sum = 0;
scanf("%d", &entrada);
for (i = 0; i < entrada; i++) {
scanf("%d %d", &x, &y);
for (j = 1; j <= y; j++, x++) {
if (x % 2 != 0) {
sum += x;
} else {
j--;
}
}
printf("%d\n", sum);
sum = 0;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment