Skip to content

Instantly share code, notes, and snippets.

@tabvn
Created October 16, 2018 14:13
Show Gist options
  • Select an option

  • Save tabvn/ef5b3b37893a6289cd93f89c90d36fef to your computer and use it in GitHub Desktop.

Select an option

Save tabvn/ef5b3b37893a6289cd93f89c90d36fef to your computer and use it in GitHub Desktop.
#include <iostream>
#include <fstream>
using namespace std;
/*
/Users/toan/ued/16-10-2018/SP
*/
ifstream fi ("SP.INP");
ofstream fo ("SP.OUT");
int main(){
int m,n,t;
long int sum;
/**
goi x la so but can phai tra tien
khi mua m chiec thi duoc tang 1 chiec, vay mua x chiec se dc tang x/m
x + x/m = n
=> x = (n*m)/(m+1)
*/
fi >> m >> n >> t;
sum = ((n*m)/(m+1)) *t;
fo << sum;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment