#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define fast ios_base::sync_with_stdio(0),cin.tie(0)
#define ll long long
#define yes cout<<"YES"<<endl;
#define no cout<<"NO"<<endl;
#define pb push_back
#define sorta(vec) sort(vec.begin(),vec.end())
#define sortd(vec) sort(vec.begin(),vec.end(),greater<int>())
#define pb push_back
#define vll vector<long long int>
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>pbds; // find_by_order, order_of_key(0-indexed)
//less , less_equal , greater , greater_equal -> rule for insertion
#define start_execution auto start = std::chrono::high_resolution_clock::now();
#define stop_execution auto stop = std::chrono::high_resolution_clock::now();
#define execution_time auto duration = std::chrono::duration_cast<std::chrono::nanoseconds>(stop - start); cerr<<"Time taken : "<<((long double)duration.count())/((long double)1e9) <<"s"<<endl;
#define nline "\n"
#define all(v) (v).begin(),(v).end()
ll int mod=1e9+7;
void debug(int x)
{
cout<<"Value Debugged is "<<x<<endl;
}
void debug(vector<int>x)
{
cout<<"Value Debugged is "<<endl;
for(auto y:x)
{
cout<<y<<" ";
}
cout<<endl;
}
ll int inv(ll int r)
{
if(r==1) return 1;
return (mod-((mod/r)*inv(mod%r))%mod+mod)%mod;
}
int ceil_div(ll int a,ll int b)
{
int k=a%b;
if(k>0) return (a/b)+1;
return a/b;
}
template<class ForwardIterator>
void read(ForwardIterator first,ForwardIterator last)
{
while (first != last)
{
cin >> (*first);
++first;
}
}
template<class T>
void read(vector<T> &v)
{
read(v.begin(), v.end());
}
//Code starts here
vector<vector<int>>ans;
int dfs(int node,vector<vector<int>>&graph,vector<int>&temp)
{
//cout<<node<<endl;
if(node==4)
{
// cout<<"f"<<endl;
}
int demand=0;
if(graph[node].size()==0)
{
temp.push_back(node);
ans.push_back(temp);
//cout<<node<<endl;
return 1;
}
if(node==3)
{
//cout<<"demand"<<endl;
}
temp.push_back(node);
for(auto x:graph[node])
{
demand+=dfs(x,graph,temp);
temp.clear();
}
return demand;
}
int main()
{
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif
fast;
start_execution
int tt=1;
//cin>>tt;
for(int cse=0;cse<tt;cse++)
{
bool ashish=false;
ll int n;
cin>>n;
vector<ll int>vec(n);
read(vec);
ll int ans=1e17;
for(int i=0;i<n;i++)
{
ll int prev=0;
ll int sum=0;
for(int j=i-1;j>=0;j--)
{
ll int temp=(prev/vec[j])+1;
sum+=temp;
prev=temp*vec[j];
}
prev=0;
for(int j=i+1;j<n;j++)
{
ll int temp=(prev/vec[j])+1;
sum+=temp;
prev=temp*vec[j];
}
ans=min(ans,sum);
}
cout<<ans<<endl;
}
stop_execution
execution_time
return 0;
}
978B - File Name | 1426B - Symmetric Matrix |
732B - Cormen --- The Best Friend Of a Man | 1369A - FashionabLee |
1474B - Different Divisors | 1632B - Roof Construction |
388A - Fox and Box Accumulation | 451A - Game With Sticks |
768A - Oath of the Night's Watch | 156C - Cipher |
545D - Queue | 459B - Pashmak and Flowers |
1538A - Stone Game | 1454C - Sequence Transformation |
165B - Burning Midnight Oil | 17A - Noldbach problem |
1350A - Orac and Factors | 1373A - Donut Shops |
26A - Almost Prime | 1656E - Equal Tree Sums |
1656B - Subtract Operation | 1656A - Good Pairs |
1367A - Short Substrings | 87A - Trains |
664A - Complicated GCD | 1635D - Infinite Set |
1462A - Favorite Sequence | 1445B - Elimination |
1656C - Make Equal With Mod | 567A - Lineland Mail |