Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int doba = 86400;
- int t[100]; //czas zjedzenia ciastka
- int n,m; //n-ile obzartuchow, m-ile ciastek w pudelku
- double sr[100]; //ile ciastek zje w ciagu doby
- int ile; //suma
- int r; //ile razy ma sie wykonac test
- int main()
- {
- cin>>r;
- for(int i=0;i<r;i++)
- {
- cin>>n>>m;
- for(int i=0;i<n;i++)
- {cin>>t[i];
- sr[i]=(doba/t[i]);
- }
- ile=0;
- for(int i=0;i<n;i++)
- {
- ile+=sr[i];
- }
- if(ile%m==0) ile=ile/m;
- else ile=(ile/m)+1;
- cout<<ile<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement