Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Suppose for a unit rise in temperature, the solubility of sugar in water increases by B100 mLg.
Chef does an experiment to check how much sugar (g) he can dissolve given that he initially has 1 liter of water at X degrees and the solubility of sugar at this temperature is A100 mLg. Also, Chef doesn’t want to lose any water so he can increase the temperature to at most 100 degrees.
Assuming no loss of water takes place during the process, find the maximum amount of sugar (g) can be dissolved in 1 liter of water under the given conditions.
###Input
###Output For each testcase, output in a single line the answer to the problem.
###Constraints
###Subtasks Subtask #1 (100 points): Original Constraints
Input:
3
40 120 1
35 120 2
40 115 3
Output:
1800
2500
2950
Test Case 1: Since solubility is increasing with temperature, the maximum solubility will be at 100 degrees which is equal to 120+(100−40)=180 100 mLg.
So for 1 liter of water the value is 180⋅10=1800 g.
Test Case 2: Since solubility is increasing with temperature, the maximum solubility will be at 100 degrees which is equal to 120+(100−35)⋅2=250100 mLg.
So for 1 liter of water the value is 250⋅10=2500 g.
/* package codechef; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public.
*/
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
while(t>0){
int a=sc.nextInt();
int b=sc.nextInt();
int c=sc.nextInt();
int x=b+(100-a)*c;
System.out.println(x*10);
--t;
}
}
}
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <math.h>
using namespace std;
map<long long,long long> arr;
long long m(long long t){
if(t < 12){
return t;
}
if(arr.find(t) != arr.end()){
return arr[t];
}
arr[t] = max(t, (m(t/2)) + (m(t/3)) +(m(t/4)));
return arr[t];
}
int main(){
int t;
cin >> t;
for(int q = 0; q < t; q++){
int a,b, c;
cin>>a>>b>>c;
cout<<(b + (100 - a)*c)*10 << "\n";
}
return 0;
}
# cook your dish here
t=int(input())
for i in range(t):
x,a,b=map(int,input().split())
print(10*(a+(100-x)*b))
In our experience, we suggest you solve this Solubility CodeChef Solution and gain some new skills from Professionals completely free and we assure you will be worth it.
If you are stuck anywhere between any coding problem, just visit Queslers to get the Solubility CodeChef Solution
I hope this Solubility CodeChef Solution would be useful for you to learn something new from this problem. If it helped you then don’t forget to bookmark our site for more Coding Solutions.
This Problem is intended for audiences of all experiences who are interested in learning about Data Science in a business context; there are no prerequisites.
Keep Learning!
More Coding Solutions >>