-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathAll_Vowels_Please.cpp
More file actions
52 lines (52 loc) · 960 Bytes
/
All_Vowels_Please.cpp
File metadata and controls
52 lines (52 loc) · 960 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include<bits/stdc++.h>
using namespace std;
int main()
{
int k; cin>>k;
string s;
if(k<25)
{
cout<<-1;
return 0;
}
int f1 = -1, f2 = -1;
for(int i=2; i*i<=k; i++)
{
if(k%i==0)
{
int x = k/i;
if(i>=5 && x>=5)
{
f1 = i, f2 = x;
break;
}
}
}
if(f1==-1)
{
cout<<-1;
return 0;
}
else if(k%25==0)
{
string ans="";
int r = k/25;
while(r--)
ans+="aeioueiouaiouaeouaeiuaeio";
cout<<ans;
}
else
{
string p = "aeiou";
string ans = "";
int r = k/5;
int rem = k%5;
while(r--)
ans+=p;
for(int j=0; j<rem; j++)
ans+=p[j];
cout<<ans<<endl;
//cout<<ans.size()<<endl;
}
return 0;
}