using namespace std;
struct height
{
long long tk,ck;
}h[100002];
bool cmp(const height &a,const height &b)
{
return(a.ck<b.ck);
}
int main ()
{
int i ;
long int sum=0,cost=0,n,m,k,area;
scanf("%11d %11d %11d",&n,&m,&k);
for(i=0;i<k;i++)
scanf("%lld %lld",&h[i].tk,&h[i].ck);
for(i=0;i<k;i++)
sum= sum + h[i].tk ;
area= n*m ;
if(sum<area)
{
printf(“Impossible\n”);
return 0;
}
else
{
sum=0 ;
sort(h,h+k,cmp);
for(i=0;i<k;i++)
{
cost= (h[i].tk)*(h[i].ck) + cost ;
sum= sum + h[i].tk;
if(sum>= (n*m))
{
int diff = sum - n*m ;
cost = cost - diff * (h[i].ck) ;
break ;
}
}
printf("%11d\n",cost);
}
sum=cost= 0 ;
return 0 ;
}