My issue
What is the issue in the code
My code
#include<stdio.h>
int main() {
int T, L, R;
scanf("%d", &T);
while (T > 0) {
scanf("%d %d", &L, &R);
// Initialize count for each test case
int count = 1;
// Check all combinations of pairs (i, j) in the range [L, R]
for (int i = L; i <= R; i++) {
for (int j = L; j <= R; j++) {
// Check if the sum i + j is a new reachable integer
if (i + j != i + i && i + j != j + j) {
count++;
}
}
}
// Print the count for the current test case
printf("%d\n", count);
// Decrement the number of test cases
T--;
}
return 0;
}
Learning course: Level up from 1* to 2*
Problem Link: Practice Problem in - CodeChef