Help me in solving MAKEDIV3 problem

My issue

for 3rd test case. 3 digit number , 105 should be answer, instead of 123

My code

#include<stdio.h>
#include<math.h>
int main()
{
    int test;
    scanf("%d",&test);
    while(test--)
    {
        int a,b,c;
        scanf("%d", &c);
        if(c==1)
        {
            printf("3\n");
        }
        else
        {
        a= pow(10,(c-1));
        b= pow(10,c);
        
        for(;a<b;a++)
        {
            if(a%3==0 && a%9!=0 && a%2==1)
             {
                 printf("%d \n",a);
                 break;
              }
        }
        }
    }
}

Learning course: Jump from 2* to 3*
Problem Link: Practice Problem in - CodeChef

@avi8794
both are correct 105 and 123 cozz its not said u have to print the smallest one.

but my code is failing for 3rd test case. Any catch ??

@avi8794
its not the same test case bro .
The test case u are failing is hidden .
ill give u one hint to solve this problem
any number which is divisible by 9 is also divisible by 3
so print n time 9
that is for n=3
print 999
this is odd and divisible by 3 too but its also divisible by 9 .
so when u subtract 6 from it u will get your answer
like 993