I have to read varying no. of input that is reading two integer in one case, 4 integer in another case, etc.
Below is the type of input I am trying to achieve. This example has 6 rows.
Sample Input
1 1 1 2
1 1 2 5
1 2 3 4
2 3
2 4
1 5 5 4
My Code
#include <stdio.h>
typedef long long int LLI;
int main(void)
{
LLI n,q,i,j,w,x,y,z,t;
scanf("%lld %lld",&n,&q);
LLI d[n],s[n];
for(i=0;i<q;i++)
{
// I don't know how to do this? The code below is what I have tried:
scanf("%lld %lld %lld %lld",&w,&x,&y,&z);
printf("%lld %lld %lld %lld \n",w,x,y,z);
}
return 0;
}
Sample Input
5 14
1 1 1 2
1 1 2 5
1 2 3 4
1 2 4 7
2 3
2 4
1 5 5 4
2 5
2 6
1 7 5 8
2 7
2 8
2 9
2 10