Easy - - Birthday Candles

http://www.codechef.com/problems/CANDLE/
For this my code is as follows…
plz help to find my mistake…

#include<iostream>
#include<math.h>
using namespace std;

int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int arr[10];
        for(int i=0;i<10;i++)
        {
            cin>>arr[i];
        }
        int minn=arr[1],index=1;
        for(int i=1;i<10;i++)
        {
            if(minn>arr[i])
            {
                minn=arr[i];
                index=i;
            }
        }
        if(minn==0)
            cout<<index<<endl;
        else if(minn!=0 && minn>arr[0])
        {
            int c=pow(10,arr[0]+1);
            c=index*c;
            cout<<c<<endl;
        }
        else if(minn!=0 && minn<=arr[0])
        {
            int b=0;
            for(int i=0;i<=minn;i++)
            {
                int p=pow(10,i);
                p=p*index;
                b+=p;
            }
            cout<<b<<endl;
        }

    }
}

I will follow this post looking to get more information

//