From 03b04ba04ef3f84a008a5a9221b60e9a21aa9552 Mon Sep 17 00:00:00 2001 From: ShazidMahsrafi Date: Sun, 25 Jun 2023 16:05:42 +0600 Subject: [PATCH] initial commit --- 122A Lucky Division/122A.cpp | 42 ++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 122A Lucky Division/122A.cpp diff --git a/122A Lucky Division/122A.cpp b/122A Lucky Division/122A.cpp new file mode 100644 index 0000000..a07e89b --- /dev/null +++ b/122A Lucky Division/122A.cpp @@ -0,0 +1,42 @@ +#include +using namespace std; +using ll = long long; + +void solve() +{ + int n; + cin>>n; + for(int num = 1; num <= 1000; ++num) + { + int r,temp; + temp = num; + bool lucky = true; + while(temp > 0) + { + r = temp % 10; + temp = temp / 10; + if(r != 4 && r != 7) + { + lucky = false; + break; + } + } + if(lucky && n%num==0) + { + cout<<"YES"<> TC; + //cin.ignore(); + while (TC--) solve(); +} \ No newline at end of file