Skip to content

Commit 92de045

Browse files
committed
Added 122A - Lucky Division.cpp
1 parent 7798f80 commit 92de045

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

122A - Lucky Division.cpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// ॐ नमः शिवाय
2+
#include<bits/stdc++.h>
3+
using namespace std;
4+
#define ll long long
5+
6+
// Code Written By: Vikash Patel
7+
// Codeforces Profile: https://codeforces.com/profile/vikashpatel
8+
9+
vector<int> lucky = {4, 7, 44, 47, 74, 77, 444, 447, 474, 477, 744, 747, 774, 777};
10+
string checkAlmostLucky(int n)
11+
{
12+
for(auto i : lucky)
13+
{
14+
if(n%i == 0)
15+
return "YES";
16+
}
17+
return "NO";
18+
}
19+
int main()
20+
{
21+
ios_base::sync_with_stdio(0);
22+
cin.tie(0);
23+
24+
int n;
25+
cin>>n;
26+
cout<<checkAlmostLucky(n)<<endl;
27+
return 0;
28+
}

0 commit comments

Comments
 (0)