#include #include using namespace std; //namaega184 int main(){ int a,b,t;scanf("%d%d%d",&a,&b,&t); if(a>b)swap(a,b); /*int s=t/a; if(t%a==0)printf("%d\n",s); else */ if(a==1){ printf("%d\n",t); return 0; } int tmp=0,ans=1000000000; for(int i=0;itmp+i)ans=tmp+i; } if(ans>(tmp=(t+a-1)/a*a))ans=tmp; printf("%d\n",ans); return 0; }