#include<iostream>
using namespace std;
int main()
{
int k,l,m,n;
long d,count=0;
cin>>k>>l>>m>>n>>d;
for(long i=1;i<=d;i++)
{
if(i%k!=0 and i%l!=0 and i%m!=0 and i%n!=0)
count++;
}
cout<<d-count;
return 0;
}
#include < bits / stdc ++. h > using namespace std ; int main () { long n ; string str ; cin >> n ; cin >> str ; long count = 0 , index ; index = str . find ( "A" ); while ( index !=- 1 ) { count ++; str . erase ( str . begin ()+ index , str . begin ()+ index + 1 ); index = str . find ( "A" ); } if ( count > n - count ) cout << "Anton" ; else if ( count < n - count ) cout << "Danik" ; else cout << "Friendship" ; return 0 ; }
Comments
Post a Comment