mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
27 lines
530 B
C++
27 lines
530 B
C++
|
#include<iostream>
|
||
|
using namespace std;
|
||
|
int main()
|
||
|
{
|
||
|
int t;
|
||
|
cin>>t;
|
||
|
while(t--)
|
||
|
{
|
||
|
int temp;
|
||
|
cin>>temp;
|
||
|
int m1=temp/150;
|
||
|
int m2=temp/200;
|
||
|
int m3=temp/350;
|
||
|
int sum=temp;
|
||
|
for(int i=0;i<=m1;++i)
|
||
|
for(int j=0;j<=m2;++j)
|
||
|
for(int k=0;k<=m3;++k)
|
||
|
{
|
||
|
int sum1=temp-150*i-200*j-350*k;
|
||
|
if(sum1<sum&&sum1>=0)
|
||
|
sum=sum1;
|
||
|
}
|
||
|
cout<<sum<<endl;
|
||
|
}
|
||
|
return 0;
|
||
|
}
|