Thursday, 26 April 2018

uva problem 12502 Three Families solution

  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5.     long long a,b,c,ans;
  6.     int t;
  7.     scanf("%d",&t);
  8.     while(t--){
  9.         cin>>a>>b>>c;
  10.     ans=(2*a-b);
  11.     ans=ans*c;
  12.     ans=(ans)/(a+b);
  13.     cout<<ans<<endl;
  14.     }
  15.     return 0;
  16. }

No comments:

Post a Comment

variable declaration of c program

#include <stdbool.h> #include<bits/stdc++.h> #include <stdio.h> #include <string.h> #include <std...