kyclvwmx's blog

By kyclvwmx, history, 7 years ago, In English

include<stdio.h>

include<bits/stdc++.h>

define clsr_ memset(dp,-1,sizeof(dp));

using namespace std; /*int Extended_Euclid(){ }*/ int n,d,e,ans; int dm=0,em=0; int main(){ ios_base::sync_with_stdio(false); cin.tie(false); cin>>n>>d>>e; dm=d; em=e*5; ans=n; for(int i=0;i*dm<=n;i++){ ans=min(ans,(n-i*dm)%em); } cout<<ans<<endl; return 0; }

Rt

Full text and comments »

  • Vote: I like it
  • -37
  • Vote: I do not like it