Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int found(int a)
- {
- int res=a/3;
- res=res*2;
- if(a%3==2)
- {
- return res+1;
- }
- else
- {
- return res;
- }
- }
- int main(void)
- {
- int a,b,cases,caseno=0;
- scanf("%d",&cases);
- while(cases--)
- {
- scanf("%d %d",&a,&b);
- printf("Case %d: %d\n",++caseno,found(b)-found(a-1));
- }
- return 0;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement