<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Thivyaa Mohan's Blog]]></title><description><![CDATA[Thivyaa Mohan's Blog]]></description><link>https://thivyaamohan.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Fri, 11 Sep 2026 01:27:53 GMT</lastBuildDate><atom:link href="https://thivyaamohan.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[122 A - Lucky Division| Codeforces Lucky Division Solution| A2oj Ladders Div 2A.]]></title><description><![CDATA[Petya considers the numbers which have 4 and 7 as lucky numbers.
Considering all the permutations we get 12 different numbers.
These are the 12 different permutations of numbers.Text
4,7,47,74,44,444,447,474,477,777,774,744
Petya also considers it al...]]></description><link>https://thivyaamohan.hashnode.dev/122-a-lucky-divisionor-codeforces-lucky-division-solutionor-a2oj-ladders-div-2a</link><guid isPermaLink="true">https://thivyaamohan.hashnode.dev/122-a-lucky-divisionor-codeforces-lucky-division-solutionor-a2oj-ladders-div-2a</guid><category><![CDATA[C++]]></category><category><![CDATA[coding]]></category><dc:creator><![CDATA[Thivyaa Mohan]]></dc:creator><pubDate>Tue, 22 Feb 2022 15:28:46 GMT</pubDate><content:encoded><![CDATA[<p>Petya considers the numbers which have 4 and 7 as lucky numbers.
Considering all the permutations we get 12 different numbers.</p>
<p>These are the 12 different permutations of numbers.<a target="_blank" href="Link">Text</a>
4,7,47,74,44,444,447,474,477,777,774,744</p>
<p>Petya also considers it almost lucky if it is divisible by some lucky number.</p>
<p>Link to the problem - <a target="_blank" href="Link">https://codeforces.com/problemset/problem/122/A</a></p>
<pre><code><span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string">&lt;stdio.h&gt;</span></span>
<span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string">&lt;iostream&gt;</span></span>
<span class="hljs-keyword">using</span> <span class="hljs-keyword">namespace</span> <span class="hljs-built_in">std</span>;

<span class="hljs-function"><span class="hljs-keyword">int</span> <span class="hljs-title">main</span><span class="hljs-params">()</span>
</span>{
        <span class="hljs-keyword">int</span> lucky_numbers[] = {<span class="hljs-number">4</span>,<span class="hljs-number">7</span>,<span class="hljs-number">47</span>,<span class="hljs-number">74</span>,<span class="hljs-number">44</span>,<span class="hljs-number">444</span>,<span class="hljs-number">447</span>,<span class="hljs-number">474</span>,<span class="hljs-number">477</span>,<span class="hljs-number">777</span>,<span class="hljs-number">774</span>,<span class="hljs-number">744</span>};
        <span class="hljs-keyword">int</span> n, count =<span class="hljs-number">0</span>;
        <span class="hljs-built_in">cin</span>&gt;&gt;n;
        <span class="hljs-keyword">for</span>(<span class="hljs-keyword">int</span> i =<span class="hljs-number">0</span>;i&lt;<span class="hljs-number">12</span>;i++)
        {
            <span class="hljs-keyword">if</span>(n%lucky_numbers[i] == <span class="hljs-number">0</span>) count++;

        }
        <span class="hljs-keyword">if</span>(count&gt;<span class="hljs-number">0</span>) <span class="hljs-built_in">cout</span>&lt;&lt;<span class="hljs-string">"yes"</span>&lt;&lt;<span class="hljs-built_in">endl</span>;
        <span class="hljs-keyword">else</span> <span class="hljs-built_in">cout</span>&lt;&lt;<span class="hljs-string">"no"</span>&lt;&lt;<span class="hljs-built_in">endl</span>;
        <span class="hljs-keyword">return</span> <span class="hljs-number">0</span>;

}
</code></pre>]]></content:encoded></item></channel></rss>