<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Updates available</title>
    <link>https://best421.tistory.com/</link>
    <description></description>
    <language>ko</language>
    <pubDate>Sun, 5 Jul 2026 21:58:27 +0900</pubDate>
    <generator>TISTORY</generator>
    <ttl>100</ttl>
    <managingEditor>best</managingEditor>
    <image>
      <title>Updates available</title>
      <url>https://tistory1.daumcdn.net/tistory/1987927/attach/95fce0a975a94340bab0dbaf986be7d7</url>
      <link>https://best421.tistory.com</link>
    </image>
    <item>
      <title>[JAVA] Random 숫자 생성</title>
      <link>https://best421.tistory.com/127</link>
      <description>&lt;p&gt;1. Random 숫자 생성 방법&lt;/p&gt;&lt;p style=&quot;margin-left: 2em;&quot;&gt;- Math.Random();&lt;/p&gt;&lt;p style=&quot;margin-left: 2em;&quot;&gt;- java.util.Random 을 사용&lt;/p&gt;&lt;p style=&quot;margin-left: 2em;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;2. 중복되지 않는 랜덤 수 10개 생성 방법&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;colorscripter-code&quot; style=&quot;color:#010101; font-family:Monaco !important; position:relative !important; overflow:auto&quot;&gt;&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin:0; padding:0; border:none; background-color:#fafafa; border-radius:4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;padding:6px; border-right:2px solid #e5e5e5&quot;&gt;&lt;div style=&quot;margin:0; padding:0; word-break:normal; text-align:right; color:#666; font-family:Monaco !important; line-height:130%&quot;&gt;&lt;div style=&quot;line-height:130%&quot;&gt;1&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;2&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;3&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;4&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;5&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;6&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;7&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;8&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;9&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;10&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;11&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;12&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;13&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;14&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;15&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;16&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;17&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;18&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;19&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;20&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;21&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;22&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;23&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;24&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;25&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;26&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;27&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;28&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;29&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;30&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;31&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;32&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;33&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;34&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;35&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;36&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;padding:6px 0&quot;&gt;&lt;div style=&quot;margin:0; padding:0; color:#010101; font-family:Monaco !important; line-height:130%&quot;&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;import&lt;/span&gt;&amp;nbsp;java.util.&lt;span style=&quot;color:#066de2&quot;&gt;Random&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#a71d5d&quot;&gt;class&lt;/span&gt;&amp;nbsp;RandomNum&amp;nbsp;{&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#a71d5d&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#a71d5d&quot;&gt;static&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#a71d5d&quot;&gt;void&lt;/span&gt;&amp;nbsp;main(&lt;span style=&quot;color:#066de2&quot;&gt;String&lt;/span&gt;[]&amp;nbsp;args)&amp;nbsp;{&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#999999&quot;&gt;/**&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*&amp;nbsp;중복되지&amp;nbsp;않는&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*&amp;nbsp;Random&amp;nbsp;수&amp;nbsp;생성1&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*/&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#066de2&quot;&gt;Random&lt;/span&gt;&amp;nbsp;rnd&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#a71d5d&quot;&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#066de2&quot;&gt;Random&lt;/span&gt;();&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;rnd.setSeed(&lt;span style=&quot;color:#066de2&quot;&gt;System&lt;/span&gt;.currentTimeMillis()); &lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;// 시드값을 설정하여 생성&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#a71d5d&quot;&gt;for&lt;/span&gt;&amp;nbsp;(&lt;span style=&quot;color:#066de2&quot;&gt;int&lt;/span&gt;&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#0099cc&quot;&gt;0&lt;/span&gt;;&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#0099cc&quot;&gt;10&lt;/span&gt;;&amp;nbsp;i&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;+&lt;/span&gt;)&amp;nbsp;{&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#066de2&quot;&gt;System&lt;/span&gt;.&lt;span style=&quot;color:#066de2&quot;&gt;out&lt;/span&gt;.&lt;span style=&quot;color:#066de2&quot;&gt;print&lt;/span&gt;(rnd.nextInt(&lt;span style=&quot;color:#0099cc&quot;&gt;100&lt;/span&gt;)&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;+&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#0099cc&quot;&gt;1&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;+&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#63a35c&quot;&gt;&quot;&amp;nbsp;&quot;&lt;/span&gt;);&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#999999&quot;&gt;/**&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*&amp;nbsp;중복되지&amp;nbsp;않는&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*&amp;nbsp;Random&amp;nbsp;수&amp;nbsp;생성2&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*/&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#066de2&quot;&gt;int&lt;/span&gt;&amp;nbsp;randomNum[]&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#a71d5d&quot;&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#066de2&quot;&gt;int&lt;/span&gt;[&lt;span style=&quot;color:#0099cc&quot;&gt;10&lt;/span&gt;];&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#a71d5d&quot;&gt;for&lt;/span&gt;&amp;nbsp;(&lt;span style=&quot;color:#066de2&quot;&gt;int&lt;/span&gt;&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#0099cc&quot;&gt;0&lt;/span&gt;;&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;randomNum.&lt;span style=&quot;color:#066de2&quot;&gt;length&lt;/span&gt;;&amp;nbsp;i&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;+&lt;/span&gt;&amp;nbsp;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;randomNum[i]&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;=&lt;/span&gt;&amp;nbsp;(&lt;span style=&quot;color:#066de2&quot;&gt;int&lt;/span&gt;)(Math.random()&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;*&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#0099cc&quot;&gt;100&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;+&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#0099cc&quot;&gt;1&lt;/span&gt;);&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#a71d5d&quot;&gt;for&lt;/span&gt;&amp;nbsp;(&amp;nbsp;&lt;span style=&quot;color:#066de2&quot;&gt;int&lt;/span&gt;&amp;nbsp;j&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#0099cc&quot;&gt;0&lt;/span&gt;;&amp;nbsp;j&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;i;&amp;nbsp;j&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;+&lt;/span&gt;&amp;nbsp;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#a71d5d&quot;&gt;if&lt;/span&gt;(&amp;nbsp;randomNum[i]&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;=&lt;/span&gt;&amp;nbsp;randomNum[j]&amp;nbsp;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#999999&quot;&gt;//&amp;nbsp;같은&amp;nbsp;수가&amp;nbsp;존재한다면&amp;nbsp;다시&amp;nbsp;랜덤&amp;nbsp;수&amp;nbsp;생성&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;i&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;-&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align:right; margin-top:-13px; margin-right:5px; font-size:9px; font-style:italic&quot;&gt;&lt;a href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; style=&quot;color: rgb(229, 229, 229);&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;vertical-align:bottom; padding:0 2px 4px 0&quot;&gt;&lt;a href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; style=&quot;color: white;&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: rgb(229, 229, 229); border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;margin-left: 2em;&quot;&gt;- Seed 기반의 난수 생성 : 컴퓨터에서 생성하는 난수는 근거, 또는 재료가 되어&lt;/p&gt;&lt;p style=&quot;margin-left: 14em;&quot;&gt;하나의 숫자를 기반으로 만들어지도록 알고리즘이 설계되어 있다.&lt;/p&gt;&lt;p style=&quot;margin-left: 14em;&quot;&gt;이러한 숫자를 Seed Number라고 한다.&lt;/p&gt;&lt;p style=&quot;margin-left: 2em;&quot;&gt;- rand.setSeed(System.currentTimeMillis()); 는 1970년 1월 1일 자정&amp;nbsp;이후로 지나온 시간을 밀리초(1/1000초) 단위로&lt;/p&gt;&lt;p style=&quot;margin-left: 2em;&quot;&gt;&amp;nbsp; 계산하여 반환하는 메소드이다. 그러므로 setSeed 메소드에서는 매번 다른 값이 전달이 되어 실행할 때마다 다른 유형의 난수가 생성된다.&lt;/p&gt;&lt;p style=&quot;margin-left: 2em;&quot;&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>BackEnd/JAVA</category>
      <category>java</category>
      <category>Math.random()</category>
      <category>Random</category>
      <category>자바</category>
      <author>best</author>
      <guid isPermaLink="true">https://best421.tistory.com/127</guid>
      <comments>https://best421.tistory.com/127#entry127comment</comments>
      <pubDate>Tue, 27 Jun 2017 09:55:35 +0900</pubDate>
    </item>
    <item>
      <title>[수학] BOJ_4673 셀프 넘버</title>
      <link>https://best421.tistory.com/125</link>
      <description>&lt;div id=&quot;problem-body&quot; style=&quot;box-sizing: border-box; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Noto Sans CJK KR&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, 나눔바른고딕, 나눔고딕, NanumGothic, 맑은고딕, &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, sans-serif; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;section id=&quot;description&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;문제&lt;/h2&gt;&lt;/div&gt;&lt;div id=&quot;problem_description&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; font-size: medium; line-height: 30px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;셀프 넘버는 1949년 인도 수학자 D.R. Kaprekar가 이름 붙였다. 양의 정수 n에 대해서 d(n)을 n과 n의 각 자리수를 더하는 함수라고 정의하자. 예를 들어, d(75) = 75+7+5 = 87이다.&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;양의 정수 n이 주어졌을 때, 이 수를 시작해서 n, d(n), d(d(n)), d(d(d(n))), ...과 같은 무한 수열을 만들 수 있다.&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;예를 들어, 33으로 시작한다면 다음 수는 33 + 3 + 3 = 39이고, 그 다음 수는 39 + 3 + 9 = 51, 다음 수는 51 + 5 + 1 = 57이다. 이런식으로 다음과 같은 수열을 만들 수 있다.&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;33, 39, 51, 57, 69, 84, 96, 111, 114, 120, 123, 129, 141, ...&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;n을 d(n)의 생성자라고 한다. 위의 수열에서 33은 39의 생성자이고, 39는 51의 생성자, 51은 57의 생성자이다. 생성자가 한 개보다 많은 경우도 있다. 예를 들어, 101은 생성자가 2개(91과 100) 있다.&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;생성자가 없는 숫자를 셀프 넘버라고 한다. 100보다 작은 셀프 넘버는 총 13개가 있다. 1, 3, 5, 7, 9, 20, 31, 42, 53, 64, 75, 86, 97&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;10000보다 작거나 같은 셀프 넘버를 한 줄에 하나씩 출력하는 프로그램을 작성하시오.&lt;/p&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;section id=&quot;input&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;입력&lt;/h2&gt;&lt;/div&gt;&lt;div id=&quot;problem_input&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; font-size: medium; line-height: 30px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;입력은 없다&lt;/p&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;section id=&quot;output&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;출력&lt;/h2&gt;&lt;/div&gt;&lt;div id=&quot;problem_output&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; font-size: medium; line-height: 30px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;10,000보다 작거나 같은 셀프 넘버를 한 줄에 하나씩 증가하는 순서로 출력한다.&lt;/p&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;div class=&quot;row&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; margin-right: -15px; margin-left: -15px;&quot;&gt;&lt;div class=&quot;col-md-6&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;section id=&quot;sampleinput&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;예제 입력&amp;nbsp;&lt;button type=&quot;button&quot; class=&quot;btn btn-link copy-button no-print&quot; data-clipboard-target=&quot;#sample-input-1&quot; style=&quot;border-radius: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 14px; line-height: 1.42857; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Noto Sans CJK KR&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, 나눔바른고딕, 나눔고딕, NanumGothic, 맑은고딕, &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, sans-serif; color: rgb(66, 139, 202); overflow: visible; cursor: pointer; text-align: center; white-space: nowrap; vertical-align: middle; user-select: none; background-image: none; border-width: 1px; border-style: solid; border-color: transparent; box-shadow: none; outline: 0px !important;&quot;&gt;복사&lt;/button&gt;&lt;/h2&gt;&lt;/div&gt;&lt;pre class=&quot;sampledata&quot; id=&quot;sample-input-1&quot; style=&quot;box-sizing: border-box; border-radius: 5px; overflow-x: scroll; overflow-y: auto; font-family: Menlo, Monaco, &amp;quot;Source Code Pro&amp;quot;, consolas, monospace; font-size: 18px; padding: 8px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; word-break: normal; word-wrap: normal; background-color: rgb(247, 247, 249); border: 1px solid rgb(225, 225, 232);&quot;&gt;&lt;/pre&gt;&lt;/section&gt;&lt;/div&gt;&lt;div class=&quot;col-md-6&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;section id=&quot;sampleoutput&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;예제 출력&amp;nbsp;&lt;button type=&quot;button&quot; class=&quot;btn btn-link copy-button no-print&quot; data-clipboard-target=&quot;#sample-output-1&quot; style=&quot;border-radius: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 14px; line-height: 1.42857; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Noto Sans CJK KR&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, 나눔바른고딕, 나눔고딕, NanumGothic, 맑은고딕, &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, sans-serif; color: rgb(66, 139, 202); overflow: visible; cursor: pointer; text-align: center; white-space: nowrap; vertical-align: middle; user-select: none; background-image: none; border-width: 1px; border-style: solid; border-color: transparent; box-shadow: none; outline: 0px !important;&quot;&gt;복사&lt;/button&gt;&lt;/h2&gt;&lt;/div&gt;&lt;pre class=&quot;sampledata&quot; id=&quot;sample-output-1&quot; style=&quot;box-sizing: border-box; border-radius: 5px; overflow-x: scroll; overflow-y: auto; font-family: Menlo, Monaco, &amp;quot;Source Code Pro&amp;quot;, consolas, monospace; font-size: 18px; padding: 8px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; word-break: normal; word-wrap: normal; background-color: rgb(247, 247, 249); border: 1px solid rgb(225, 225, 232);&quot;&gt;1
3
5
7
9
20
31
42
53
64
 |
 |       &amp;lt;-- a lot more numbers
 |
9903
9914
9925
9927
9938
9949
9960
9971
9982
9993
&lt;/pre&gt;&lt;/section&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Noto Sans CJK KR&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, 나눔바른고딕, 나눔고딕, NanumGothic, 맑은고딕, &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, sans-serif; border-radius: 0px !important;&quot;&gt;&lt;section id=&quot;source&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;코드&lt;/h2&gt;&lt;/div&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;colorscripter-code&quot; style=&quot;color:#f0f0f0; font-family:Monaco !important; position:relative !important; overflow:auto&quot;&gt;&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin:0; padding:0; border:none; background-color:#272727; border-radius:4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;padding:6px; border-right:2px solid #4f4f4f&quot;&gt;&lt;div style=&quot;margin:0; padding:0; word-break:normal; text-align:right; color:#aaa; font-family:Monaco !important; line-height:130%&quot;&gt;&lt;div style=&quot;line-height:130%&quot;&gt;1&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;2&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;3&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;4&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;5&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;6&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;7&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;8&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;9&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;10&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;11&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;12&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;13&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;14&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;15&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;16&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;17&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;18&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;19&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;20&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;21&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;22&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;23&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;24&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;25&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;26&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;27&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;28&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;29&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;30&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;31&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;32&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;33&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;34&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;35&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;36&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;37&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;38&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;39&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;40&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;41&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;42&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;43&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;44&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;45&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;46&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;padding:6px 0&quot;&gt;&lt;div style=&quot;margin:0; padding:0; color:#f0f0f0; font-family:Monaco !important; line-height:130%&quot;&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;package&lt;/span&gt;&amp;nbsp;math;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;/**&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;&amp;nbsp;*&amp;nbsp;https://www.acmicpc.net/problem/4673&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;&amp;nbsp;*&amp;nbsp;셀프&amp;nbsp;넘버&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;&amp;nbsp;*&amp;nbsp;@author&amp;nbsp;minjung&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;&amp;nbsp;*&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;&amp;nbsp;*/&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;class&lt;/span&gt;&amp;nbsp;baekjoon_4673&amp;nbsp;{&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;static&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;void&lt;/span&gt;&amp;nbsp;main(&lt;span style=&quot;color:#4be6fa&quot;&gt;String&lt;/span&gt;[]&amp;nbsp;args)&amp;nbsp;{&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#999999&quot;&gt;//숫자&amp;nbsp;1부터&amp;nbsp;10000까지&amp;nbsp;담기&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;[]&amp;nbsp;bucket&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;[&lt;span style=&quot;color:#c10aff&quot;&gt;10001&lt;/span&gt;];&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;0&lt;/span&gt;;&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;10001&lt;/span&gt;;&amp;nbsp;i&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;bucket[i]&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;i;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#999999&quot;&gt;//&amp;nbsp;i를&amp;nbsp;생성자로&amp;nbsp;갖는&amp;nbsp;수를&amp;nbsp;담을&amp;nbsp;값&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;result&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;0&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;for&lt;/span&gt;&amp;nbsp;(&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;;&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;10001&lt;/span&gt;;&amp;nbsp;i&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;sumOfValue(i);&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;if&lt;/span&gt;(&amp;nbsp;result&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;10000&lt;/span&gt;&amp;nbsp;)&amp;nbsp;{&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;continue&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;else&lt;/span&gt;&amp;nbsp;{&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;bucket[result]&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;for&lt;/span&gt;&amp;nbsp;(&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;;&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;10000&lt;/span&gt;;&amp;nbsp;i&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&amp;nbsp;)&amp;nbsp;{&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;if&lt;/span&gt;(bucket[i]&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;System&lt;/span&gt;.&lt;span style=&quot;color:#4be6fa&quot;&gt;out&lt;/span&gt;.&lt;span style=&quot;color:#4be6fa&quot;&gt;println&lt;/span&gt;(bucket[i]);&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;static&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;sumOfValue(&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;number){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#999999&quot;&gt;//&amp;nbsp;각&amp;nbsp;자리수를&amp;nbsp;더하는&amp;nbsp;함수,&amp;nbsp;수열의&amp;nbsp;다음&amp;nbsp;값&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;NewNum&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;number&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&amp;nbsp;number&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color:#c10aff&quot;&gt;1000&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&amp;nbsp;(number&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color:#c10aff&quot;&gt;100&lt;/span&gt;)%&lt;span style=&quot;color:#c10aff&quot;&gt;10&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&amp;nbsp;(number&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color:#c10aff&quot;&gt;10&lt;/span&gt;)%&lt;span style=&quot;color:#c10aff&quot;&gt;10&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&amp;nbsp;number%&lt;span style=&quot;color:#c10aff&quot;&gt;10&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;return&lt;/span&gt;&amp;nbsp;NewNum;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align:right; margin-top:-13px; margin-right:5px; font-size:9px; font-style:italic&quot;&gt;&lt;a href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; style=&quot;color: rgb(79, 79, 79);&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;vertical-align:bottom; padding:0 2px 4px 0&quot;&gt;&lt;a href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; style=&quot;color: white;&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: rgb(79, 79, 79); border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>Algorithm/Baekjoon Online Judge</category>
      <category>algorithm</category>
      <category>Baekjoon Online Judege</category>
      <category>boj</category>
      <category>java</category>
      <author>best</author>
      <guid isPermaLink="true">https://best421.tistory.com/125</guid>
      <comments>https://best421.tistory.com/125#entry125comment</comments>
      <pubDate>Tue, 25 Apr 2017 16:22:11 +0900</pubDate>
    </item>
    <item>
      <title>[수학] BOJ_2581 소수</title>
      <link>https://best421.tistory.com/124</link>
      <description>&lt;div id=&quot;problem-body&quot; style=&quot;box-sizing: border-box; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Noto Sans CJK KR&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, 나눔바른고딕, 나눔고딕, NanumGothic, 맑은고딕, &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, sans-serif; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;section id=&quot;description&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;문제&lt;/h2&gt;&lt;/div&gt;&lt;div id=&quot;problem_description&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; font-size: medium; line-height: 30px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;자연수 M과 N이 주어질 때 M이상 N이하의 자연수 중 소수인 것을 모두 골라 이들 소수의 합과 최소값을 찾는 프로그램을 작성하시오.&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;예를 들어 M=60, N=100이 경우 60이상 100이하의 자연수 중 소수는 61, 67, 71, 73, 79, 83, 89, 97 총 8개가 있으므로, 이들 소수의 합은 620이고, 최소값은 61이 된다.&lt;/p&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;section id=&quot;input&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;입력&lt;/h2&gt;&lt;/div&gt;&lt;div id=&quot;problem_input&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; font-size: medium; line-height: 30px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;입력의 첫째 줄에 M이, 둘째 줄에 N이 주어진다.&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;M과 N은 10,000이하의 자연수이며, M은 N보다 같거나 작다.&lt;/p&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;section id=&quot;output&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;출력&lt;/h2&gt;&lt;/div&gt;&lt;div id=&quot;problem_output&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; font-size: medium; line-height: 30px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;M이상 N이하의 자연수 중 소수인 것을 모두 찾아 첫째 줄에 그 합을, 둘째 줄에 그 중 최소값을 출력한다.&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;단, M이상 N이하의 자연수 중 소수가 없을 경우는 첫째 줄에 -1을 출력한다.&lt;/p&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;div class=&quot;row&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; margin-right: -15px; margin-left: -15px;&quot;&gt;&lt;div class=&quot;col-md-6&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;section id=&quot;sampleinput&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;예제 입력&amp;nbsp;&lt;button type=&quot;button&quot; class=&quot;btn btn-link copy-button no-print&quot; data-clipboard-target=&quot;#sample-input-1&quot; style=&quot;border-radius: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 14px; line-height: 1.42857; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Noto Sans CJK KR&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, 나눔바른고딕, 나눔고딕, NanumGothic, 맑은고딕, &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, sans-serif; color: rgb(66, 139, 202); overflow: visible; cursor: pointer; text-align: center; white-space: nowrap; vertical-align: middle; user-select: none; background-image: none; border-width: 1px; border-style: solid; border-color: transparent; box-shadow: none; outline: 0px !important;&quot;&gt;복사&lt;/button&gt;&lt;/h2&gt;&lt;/div&gt;&lt;pre class=&quot;sampledata&quot; id=&quot;sample-input-1&quot; style=&quot;box-sizing: border-box; border-radius: 5px; overflow-x: scroll; overflow-y: auto; font-family: Menlo, Monaco, &amp;quot;Source Code Pro&amp;quot;, consolas, monospace; font-size: 18px; padding: 8px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; word-break: normal; word-wrap: normal; background-color: rgb(247, 247, 249); border: 1px solid rgb(225, 225, 232);&quot;&gt;60
100&lt;/pre&gt;&lt;/section&gt;&lt;/div&gt;&lt;div class=&quot;col-md-6&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;section id=&quot;sampleoutput&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;예제 출력&amp;nbsp;&lt;button type=&quot;button&quot; class=&quot;btn btn-link copy-button no-print&quot; data-clipboard-target=&quot;#sample-output-1&quot; style=&quot;border-radius: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 14px; line-height: 1.42857; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Noto Sans CJK KR&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, 나눔바른고딕, 나눔고딕, NanumGothic, 맑은고딕, &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, sans-serif; color: rgb(66, 139, 202); overflow: visible; cursor: pointer; text-align: center; white-space: nowrap; vertical-align: middle; user-select: none; background-image: none; border-width: 1px; border-style: solid; border-color: transparent; box-shadow: none; outline: 0px !important;&quot;&gt;복사&lt;/button&gt;&lt;/h2&gt;&lt;/div&gt;&lt;pre class=&quot;sampledata&quot; id=&quot;sample-output-1&quot; style=&quot;box-sizing: border-box; border-radius: 5px; overflow-x: scroll; overflow-y: auto; font-family: Menlo, Monaco, &amp;quot;Source Code Pro&amp;quot;, consolas, monospace; font-size: 18px; padding: 8px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; word-break: normal; word-wrap: normal; background-color: rgb(247, 247, 249); border: 1px solid rgb(225, 225, 232);&quot;&gt;620
61&lt;/pre&gt;&lt;/section&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;section id=&quot;hint&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;코드&lt;/h2&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Noto Sans CJK KR&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, 나눔바른고딕, 나눔고딕, NanumGothic, 맑은고딕, &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, sans-serif; border-radius: 0px !important;&quot;&gt;&lt;section id=&quot;source&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;colorscripter-code&quot; style=&quot;color:#f0f0f0; font-family:Monaco !important; position:relative !important; overflow:auto&quot;&gt;&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin:0; padding:0; border:none; background-color:#272727; border-radius:4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;padding:6px; border-right:2px solid #4f4f4f&quot;&gt;&lt;div style=&quot;margin:0; padding:0; word-break:normal; text-align:right; color:#aaa; font-family:Monaco !important; line-height:130%&quot;&gt;&lt;div style=&quot;line-height:130%&quot;&gt;1&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;2&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;3&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;4&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;5&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;6&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;7&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;8&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;9&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;10&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;11&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;12&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;13&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;14&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;15&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;16&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;17&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;18&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;19&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;20&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;21&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;22&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;23&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;24&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;25&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;26&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;27&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;28&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;29&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;30&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;31&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;32&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;33&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;34&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;35&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;36&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;37&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;38&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;39&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;40&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;41&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;42&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;43&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;44&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;45&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;46&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;47&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;48&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;49&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;50&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;51&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;52&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;53&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;54&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;55&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;56&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;57&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;58&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;59&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;60&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;61&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;62&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;63&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;64&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;65&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;66&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;67&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;68&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;69&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;70&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;71&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;72&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;73&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;74&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;padding:6px 0&quot;&gt;&lt;div style=&quot;margin:0; padding:0; color:#f0f0f0; font-family:Monaco !important; line-height:130%&quot;&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;package&lt;/span&gt;&amp;nbsp;math;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;import&lt;/span&gt;&amp;nbsp;java.util.&lt;span style=&quot;color:#4be6fa&quot;&gt;Scanner&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;/**&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;&amp;nbsp;*&amp;nbsp;https://www.acmicpc.net/problem/2581&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;&amp;nbsp;*&amp;nbsp;소수&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;&amp;nbsp;*&amp;nbsp;@author&amp;nbsp;minjung&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;&amp;nbsp;*&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;&amp;nbsp;*/&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;class&lt;/span&gt;&amp;nbsp;baekjoon_2581&amp;nbsp;{&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;static&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;void&lt;/span&gt;&amp;nbsp;main(&lt;span style=&quot;color:#4be6fa&quot;&gt;String&lt;/span&gt;[]&amp;nbsp;args)&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;throws&lt;/span&gt;&amp;nbsp;Exception&amp;nbsp;{&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;Scanner&lt;/span&gt;&amp;nbsp;sc&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;Scanner&lt;/span&gt;(&lt;span style=&quot;color:#4be6fa&quot;&gt;System&lt;/span&gt;.&lt;span style=&quot;color:#4be6fa&quot;&gt;in&lt;/span&gt;);&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;M&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;0&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;N&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;0&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;while&lt;/span&gt;&amp;nbsp;(&amp;nbsp;N&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;M&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;|&lt;/span&gt;&amp;nbsp;M&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;10000&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;|&lt;/span&gt;&amp;nbsp;N&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;10000&lt;/span&gt;)&amp;nbsp;{&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;M&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;sc.nextInt();&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;N&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;sc.nextInt();&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;sum&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;0&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;min&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;0&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;first&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;0&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;boolean&lt;/span&gt;&amp;nbsp;isPrime&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;true&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;if&lt;/span&gt;&amp;nbsp;(&amp;nbsp;M&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;&amp;nbsp;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;M&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;2&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;for&lt;/span&gt;(&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;M;&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;N;&amp;nbsp;i&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&amp;nbsp;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;for&lt;/span&gt;&amp;nbsp;(&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;j&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;2&lt;/span&gt;;&amp;nbsp;j&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;i;&amp;nbsp;j&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;)&amp;nbsp;{&amp;nbsp;&lt;span style=&quot;color:#999999&quot;&gt;//소수&amp;nbsp;찾기&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;if&lt;/span&gt;(&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;2&lt;/span&gt;&amp;nbsp;)&amp;nbsp;{&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;min&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;2&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sum&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;2&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;first&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;break&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;if&lt;/span&gt;&amp;nbsp;(&amp;nbsp;i%j&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;0&lt;/span&gt;&amp;nbsp;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;isPrime&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;false&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;break&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;else&lt;/span&gt;&amp;nbsp;{&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;isPrime&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;true&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;if&lt;/span&gt;&amp;nbsp;(&amp;nbsp;isPrime&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;amp;&lt;/span&gt;&amp;nbsp;first&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;0&lt;/span&gt;&amp;nbsp;)&amp;nbsp;{&amp;nbsp;&lt;span style=&quot;color:#999999&quot;&gt;//최소값&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;min&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;i;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sum&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;i;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;first&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;else&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;if&lt;/span&gt;(&amp;nbsp;isPrime&amp;nbsp;){&amp;nbsp;&lt;span style=&quot;color:#999999&quot;&gt;//소수들의&amp;nbsp;합&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sum&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;i;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;if&lt;/span&gt;&amp;nbsp;(&amp;nbsp;min&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;0&lt;/span&gt;&amp;nbsp;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;System&lt;/span&gt;.&lt;span style=&quot;color:#4be6fa&quot;&gt;out&lt;/span&gt;.&lt;span style=&quot;color:#4be6fa&quot;&gt;println&lt;/span&gt;(&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;);&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;else&lt;/span&gt;&amp;nbsp;{&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;System&lt;/span&gt;.&lt;span style=&quot;color:#4be6fa&quot;&gt;out&lt;/span&gt;.&lt;span style=&quot;color:#4be6fa&quot;&gt;println&lt;/span&gt;(sum);&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;System&lt;/span&gt;.&lt;span style=&quot;color:#4be6fa&quot;&gt;out&lt;/span&gt;.&lt;span style=&quot;color:#4be6fa&quot;&gt;println&lt;/span&gt;(min);&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align:right; margin-top:-13px; margin-right:5px; font-size:9px; font-style:italic&quot;&gt;&lt;a href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; style=&quot;color: rgb(79, 79, 79);&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;vertical-align:bottom; padding:0 2px 4px 0&quot;&gt;&lt;a href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; style=&quot;color: white;&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: rgb(79, 79, 79); border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>Algorithm/Baekjoon Online Judge</category>
      <category>algorithm</category>
      <category>Baekjoon Online Judege</category>
      <category>boj</category>
      <category>java</category>
      <author>best</author>
      <guid isPermaLink="true">https://best421.tistory.com/124</guid>
      <comments>https://best421.tistory.com/124#entry124comment</comments>
      <pubDate>Tue, 25 Apr 2017 16:20:23 +0900</pubDate>
    </item>
    <item>
      <title>[수학] BOJ_1977 완전제곱수</title>
      <link>https://best421.tistory.com/123</link>
      <description>&lt;div id=&quot;problem-body&quot; style=&quot;box-sizing: border-box; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Noto Sans CJK KR&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, 나눔바른고딕, 나눔고딕, NanumGothic, 맑은고딕, &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, sans-serif; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;section id=&quot;description&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;문제&lt;/h2&gt;&lt;/div&gt;&lt;div id=&quot;problem_description&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; font-size: medium; line-height: 30px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;M과 N이 주어질 때 M이상 N이하의 자연수 중 완전제곱수인 것을 모두 골라 그 합을 구하고 그 중 최소값을 찾는 프로그램을 작성하시오. 예를 들어 M=60, N=100인 경우&amp;nbsp;60이상 100이하의 자연수 중 완전제곱수는&amp;nbsp;64,&amp;nbsp; 81,&amp;nbsp; 100&amp;nbsp;이렇게 총 3개가 있으므로 그 합은 245가 되고 이 중 최소값은 64가 된다.&lt;/p&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;section id=&quot;input&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;입력&lt;/h2&gt;&lt;/div&gt;&lt;div id=&quot;problem_input&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; font-size: medium; line-height: 30px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;첫째 줄에 M이, 둘째 줄에 N이 주어진다. M과 N은 10000이하의 자연수이며 M은 N보다 같거나 작다.&lt;/p&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;section id=&quot;output&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;출력&lt;/h2&gt;&lt;/div&gt;&lt;div id=&quot;problem_output&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; font-size: medium; line-height: 30px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;M이상 N이하의 자연수 중 완전제곱수인 것을 모두 찾아 첫째 줄에 그 합을, 둘째 줄에 그 중 최소값을 출력한다. 단, M이상 N이하의 자연수 중 완전제곱수가 없을 경우는 첫째 줄에 -1을 출력한다.&lt;/p&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;div class=&quot;row&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; margin-right: -15px; margin-left: -15px;&quot;&gt;&lt;div class=&quot;col-md-6&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;section id=&quot;sampleinput&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;예제 입력&amp;nbsp;&lt;button type=&quot;button&quot; class=&quot;btn btn-link copy-button no-print&quot; data-clipboard-target=&quot;#sample-input-1&quot; style=&quot;border-radius: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 14px; line-height: 1.42857; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Noto Sans CJK KR&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, 나눔바른고딕, 나눔고딕, NanumGothic, 맑은고딕, &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, sans-serif; color: rgb(66, 139, 202); overflow: visible; cursor: pointer; text-align: center; white-space: nowrap; vertical-align: middle; user-select: none; background-image: none; border-width: 1px; border-style: solid; border-color: transparent; box-shadow: none; outline: 0px !important;&quot;&gt;복사&lt;/button&gt;&lt;/h2&gt;&lt;/div&gt;&lt;pre class=&quot;sampledata&quot; id=&quot;sample-input-1&quot; style=&quot;box-sizing: border-box; border-radius: 5px; overflow-x: scroll; overflow-y: auto; font-family: Menlo, Monaco, &amp;quot;Source Code Pro&amp;quot;, consolas, monospace; font-size: 18px; padding: 8px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; word-break: normal; word-wrap: normal; background-color: rgb(247, 247, 249); border: 1px solid rgb(225, 225, 232);&quot;&gt;60
100
&lt;/pre&gt;&lt;/section&gt;&lt;/div&gt;&lt;div class=&quot;col-md-6&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;section id=&quot;sampleoutput&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;예제 출력&amp;nbsp;&lt;button type=&quot;button&quot; class=&quot;btn btn-link copy-button no-print&quot; data-clipboard-target=&quot;#sample-output-1&quot; style=&quot;border-radius: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 14px; line-height: 1.42857; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Noto Sans CJK KR&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, 나눔바른고딕, 나눔고딕, NanumGothic, 맑은고딕, &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, sans-serif; color: rgb(66, 139, 202); overflow: visible; cursor: pointer; text-align: center; white-space: nowrap; vertical-align: middle; user-select: none; background-image: none; border-width: 1px; border-style: solid; border-color: transparent; box-shadow: none; outline: 0px !important;&quot;&gt;복사&lt;/button&gt;&lt;/h2&gt;&lt;/div&gt;&lt;pre class=&quot;sampledata&quot; id=&quot;sample-output-1&quot; style=&quot;box-sizing: border-box; border-radius: 5px; overflow-x: scroll; overflow-y: auto; font-family: Menlo, Monaco, &amp;quot;Source Code Pro&amp;quot;, consolas, monospace; font-size: 18px; padding: 8px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; word-break: normal; word-wrap: normal; background-color: rgb(247, 247, 249); border: 1px solid rgb(225, 225, 232);&quot;&gt;245
64
&lt;/pre&gt;&lt;/section&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Noto Sans CJK KR&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, 나눔바른고딕, 나눔고딕, NanumGothic, 맑은고딕, &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, sans-serif; border-radius: 0px !important;&quot;&gt;&lt;section id=&quot;source&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;코드&lt;/h2&gt;&lt;/div&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-right: 0px; margin-bottom: 10px; color: rgb(85, 85, 85); border-radius: 0px !important;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;colorscripter-code&quot; style=&quot;color:#f0f0f0; font-family:Monaco !important; position:relative !important; overflow:auto&quot;&gt;&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin:0; padding:0; border:none; background-color:#272727; border-radius:4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;padding:6px; border-right:2px solid #4f4f4f&quot;&gt;&lt;div style=&quot;margin:0; padding:0; word-break:normal; text-align:right; color:#aaa; font-family:Monaco !important; line-height:130%&quot;&gt;&lt;div style=&quot;line-height:130%&quot;&gt;1&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;2&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;3&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;4&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;5&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;6&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;7&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;8&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;9&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;10&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;11&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;12&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;13&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;14&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;15&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;16&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;17&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;18&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;19&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;20&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;21&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;22&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;23&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;24&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;25&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;26&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;27&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;28&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;29&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;30&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;31&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;32&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;33&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;34&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;35&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;36&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;37&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;38&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;39&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;padding:6px 0&quot;&gt;&lt;div style=&quot;margin:0; padding:0; color:#f0f0f0; font-family:Monaco !important; line-height:130%&quot;&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;package&lt;/span&gt;&amp;nbsp;math;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;import&lt;/span&gt;&amp;nbsp;java.util.&lt;span style=&quot;color:#4be6fa&quot;&gt;Scanner&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;class&lt;/span&gt;&amp;nbsp;baekjoon_1977&amp;nbsp;{&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;static&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;void&lt;/span&gt;&amp;nbsp;main(&lt;span style=&quot;color:#4be6fa&quot;&gt;String&lt;/span&gt;[]&amp;nbsp;args)&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;throws&lt;/span&gt;&amp;nbsp;Exception{&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;Scanner&lt;/span&gt;&amp;nbsp;sc&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;Scanner&lt;/span&gt;(&lt;span style=&quot;color:#4be6fa&quot;&gt;System&lt;/span&gt;.&lt;span style=&quot;color:#4be6fa&quot;&gt;in&lt;/span&gt;);&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;M&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;sc.nextInt();&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;N&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;sc.nextInt();&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;sum&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;0&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;min&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;0&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;first&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;0&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;for&lt;/span&gt;(&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;M;&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;N;&amp;nbsp;i&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&amp;nbsp;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;for&lt;/span&gt;(&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;j&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;;&amp;nbsp;j&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;100&lt;/span&gt;;&amp;nbsp;j&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&amp;nbsp;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;if&lt;/span&gt;&amp;nbsp;(&amp;nbsp;(j&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;*&lt;/span&gt;j)&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;amp;&lt;/span&gt;&amp;nbsp;first&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;0&lt;/span&gt;&amp;nbsp;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sum&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;i;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;min&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;i;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;first&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;else&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;if&lt;/span&gt;&amp;nbsp;(&amp;nbsp;(j&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;*&lt;/span&gt;j)&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;amp;&lt;/span&gt;&amp;nbsp;first&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;&amp;nbsp;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sum&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;i;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;if&lt;/span&gt;&amp;nbsp;(min&amp;nbsp;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#0086b3&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;0&lt;/span&gt;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;System&lt;/span&gt;.&lt;span style=&quot;color:#4be6fa&quot;&gt;out&lt;/span&gt;.&lt;span style=&quot;color:#4be6fa&quot;&gt;println&lt;/span&gt;(&lt;span style=&quot;color:#ffd500&quot;&gt;&quot;-1&quot;&lt;/span&gt;);&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;else&lt;/span&gt;&amp;nbsp;{&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;System&lt;/span&gt;.&lt;span style=&quot;color:#4be6fa&quot;&gt;out&lt;/span&gt;.&lt;span style=&quot;color:#4be6fa&quot;&gt;println&lt;/span&gt;(sum);&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;System&lt;/span&gt;.&lt;span style=&quot;color:#4be6fa&quot;&gt;out&lt;/span&gt;.&lt;span style=&quot;color:#4be6fa&quot;&gt;println&lt;/span&gt;(min);&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align:right; margin-top:-13px; margin-right:5px; font-size:9px; font-style:italic&quot;&gt;&lt;a href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; style=&quot;color: rgb(79, 79, 79);&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;vertical-align:bottom; padding:0 2px 4px 0&quot;&gt;&lt;a href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; style=&quot;color: white;&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: rgb(79, 79, 79); border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>Algorithm/Baekjoon Online Judge</category>
      <category>algorithm</category>
      <category>Baekjoon Online Judege</category>
      <category>boj</category>
      <category>java</category>
      <author>best</author>
      <guid isPermaLink="true">https://best421.tistory.com/123</guid>
      <comments>https://best421.tistory.com/123#entry123comment</comments>
      <pubDate>Tue, 25 Apr 2017 16:18:53 +0900</pubDate>
    </item>
    <item>
      <title>[정렬] BOJ_11650 좌표 정렬하기</title>
      <link>https://best421.tistory.com/122</link>
      <description>&lt;div id=&quot;problem-body&quot; style=&quot;box-sizing: border-box; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Noto Sans CJK KR&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, 나눔바른고딕, 나눔고딕, NanumGothic, 맑은고딕, &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, sans-serif; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;section id=&quot;description&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;문제&lt;/h2&gt;&lt;/div&gt;&lt;div id=&quot;problem_description&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; font-size: medium; line-height: 30px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;2차원 평면 위의 점 N개가 주어진다. 좌표를 x좌표가 증가하는 순으로, x좌표가 같으면 y좌표가 증가하는 순서로 정렬한 다음 출력하는 프로그램을 작성하시오.&lt;/p&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;section id=&quot;input&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;입력&lt;/h2&gt;&lt;/div&gt;&lt;div id=&quot;problem_input&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; font-size: medium; line-height: 30px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;첫째 줄에 점의 개수 N (1 ≤ N ≤ 100,000)이 주어진다. 둘째 줄부터 N개의 줄에는 i번점의 위치 x&lt;span style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; font-size: 12px; line-height: 0; vertical-align: baseline; bottom: -0.25em;&quot;&gt;i&lt;/span&gt;와 y&lt;span style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; font-size: 12px; line-height: 0; vertical-align: baseline; bottom: -0.25em;&quot;&gt;i&lt;/span&gt;가 주어진다. (-100,000 ≤ x&lt;span style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; font-size: 12px; line-height: 0; vertical-align: baseline; bottom: -0.25em;&quot;&gt;i&lt;/span&gt;, y&lt;span style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; font-size: 12px; line-height: 0; vertical-align: baseline; bottom: -0.25em;&quot;&gt;i&lt;/span&gt;&amp;nbsp;≤ 100,000) 좌표는 항상 정수이고, 위치가 같은 두 점은 없다.&lt;/p&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;section id=&quot;output&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;출력&lt;/h2&gt;&lt;/div&gt;&lt;div id=&quot;problem_output&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; font-size: medium; line-height: 30px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;첫째 줄부터 N개의 줄에 점을 정렬한&amp;nbsp;결과를 출력한다.&lt;/p&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;div class=&quot;row&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; margin-right: -15px; margin-left: -15px;&quot;&gt;&lt;div class=&quot;col-md-6&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;section id=&quot;sampleinput&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;예제 입력&amp;nbsp;&lt;button type=&quot;button&quot; class=&quot;btn btn-link copy-button no-print&quot; data-clipboard-target=&quot;#sample-input-1&quot; style=&quot;border-radius: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 14px; line-height: 1.42857; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Noto Sans CJK KR&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, 나눔바른고딕, 나눔고딕, NanumGothic, 맑은고딕, &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, sans-serif; color: rgb(66, 139, 202); overflow: visible; cursor: pointer; text-align: center; white-space: nowrap; vertical-align: middle; user-select: none; background-image: none; border-width: 1px; border-style: solid; border-color: transparent; box-shadow: none; outline: 0px !important;&quot;&gt;복사&lt;/button&gt;&lt;/h2&gt;&lt;/div&gt;&lt;pre class=&quot;sampledata&quot; id=&quot;sample-input-1&quot; style=&quot;box-sizing: border-box; border-radius: 5px; overflow-x: scroll; overflow-y: auto; font-family: Menlo, Monaco, &amp;quot;Source Code Pro&amp;quot;, consolas, monospace; font-size: 18px; padding: 8px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; word-break: normal; word-wrap: normal; background-color: rgb(247, 247, 249); border: 1px solid rgb(225, 225, 232);&quot;&gt;5
3 4
1 1
1 -1
2 2
3 3
&lt;/pre&gt;&lt;/section&gt;&lt;/div&gt;&lt;div class=&quot;col-md-6&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;section id=&quot;sampleoutput&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;예제 출력&amp;nbsp;&lt;button type=&quot;button&quot; class=&quot;btn btn-link copy-button no-print&quot; data-clipboard-target=&quot;#sample-output-1&quot; style=&quot;border-radius: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 14px; line-height: 1.42857; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Noto Sans CJK KR&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, 나눔바른고딕, 나눔고딕, NanumGothic, 맑은고딕, &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, sans-serif; color: rgb(66, 139, 202); overflow: visible; cursor: pointer; text-align: center; white-space: nowrap; vertical-align: middle; user-select: none; background-image: none; border-width: 1px; border-style: solid; border-color: transparent; box-shadow: none; outline: 0px !important;&quot;&gt;복사&lt;/button&gt;&lt;/h2&gt;&lt;/div&gt;&lt;pre class=&quot;sampledata&quot; id=&quot;sample-output-1&quot; style=&quot;box-sizing: border-box; border-radius: 5px; overflow-x: scroll; overflow-y: auto; font-family: Menlo, Monaco, &amp;quot;Source Code Pro&amp;quot;, consolas, monospace; font-size: 18px; padding: 8px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; word-break: normal; word-wrap: normal; background-color: rgb(247, 247, 249); border: 1px solid rgb(225, 225, 232);&quot;&gt;1 -1
1 1
2 2
3 3
3 4
&lt;/pre&gt;&lt;/section&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;section id=&quot;hint&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;코드&lt;/h2&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Noto Sans CJK KR&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, 나눔바른고딕, 나눔고딕, NanumGothic, 맑은고딕, &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, sans-serif; border-radius: 0px !important;&quot;&gt;&lt;section id=&quot;source&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;colorscripter-code&quot; style=&quot;color:#f0f0f0; font-family:Monaco !important; position:relative !important; overflow:auto&quot;&gt;&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin:0; padding:0; border:none; background-color:#272727; border-radius:4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;padding:6px; border-right:2px solid #4f4f4f&quot;&gt;&lt;div style=&quot;margin:0; padding:0; word-break:normal; text-align:right; color:#aaa; font-family:Monaco !important; line-height:130%&quot;&gt;&lt;div style=&quot;line-height:130%&quot;&gt;1&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;2&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;3&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;4&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;5&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;6&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;7&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;8&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;9&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;10&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;11&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;12&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;13&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;14&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;15&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;16&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;17&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;18&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;19&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;20&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;21&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;22&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;23&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;24&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;25&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;26&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;27&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;28&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;29&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;30&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;31&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;32&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;33&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;34&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;35&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;36&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;37&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;38&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;39&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;40&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;41&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;42&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;43&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;44&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;45&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;46&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;47&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;48&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;49&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;50&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;51&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;52&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;53&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;54&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;55&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;56&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;57&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;58&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;59&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;60&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;61&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;62&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;63&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;64&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;65&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;66&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;67&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;68&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;69&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;70&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;71&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;padding:6px 0&quot;&gt;&lt;div style=&quot;margin:0; padding:0; color:#f0f0f0; font-family:Monaco !important; line-height:130%&quot;&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;package&lt;/span&gt;&amp;nbsp;sort;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;import&lt;/span&gt;&amp;nbsp;java.util.ArrayList;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;import&lt;/span&gt;&amp;nbsp;java.util.Collections;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;import&lt;/span&gt;&amp;nbsp;java.util.Comparator;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;import&lt;/span&gt;&amp;nbsp;java.util.&lt;span style=&quot;color:#4be6fa&quot;&gt;Scanner&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;class&lt;/span&gt;&amp;nbsp;XY&amp;nbsp;{&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;x;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;y;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;public&lt;/span&gt;&amp;nbsp;XY(&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;x,&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;y){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;this&lt;/span&gt;.x&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;x;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;this&lt;/span&gt;.y&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;y;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;/**&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;&amp;nbsp;*&amp;nbsp;https://www.acmicpc.net/problem/11650&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;&amp;nbsp;*&amp;nbsp;좌표&amp;nbsp;정렬하기&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;&amp;nbsp;*&amp;nbsp;@author&amp;nbsp;minjung&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;&amp;nbsp;*&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;&amp;nbsp;*/&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;class&lt;/span&gt;&amp;nbsp;baekjoon_11650&amp;nbsp;{&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;static&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;void&lt;/span&gt;&amp;nbsp;main(&lt;span style=&quot;color:#4be6fa&quot;&gt;String&lt;/span&gt;[]&amp;nbsp;args)&amp;nbsp;{&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#999999&quot;&gt;//&amp;nbsp;TODO&amp;nbsp;Auto-generated&amp;nbsp;method&amp;nbsp;stub&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;Scanner&lt;/span&gt;&amp;nbsp;sc&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;Scanner&lt;/span&gt;(&lt;span style=&quot;color:#4be6fa&quot;&gt;System&lt;/span&gt;.&lt;span style=&quot;color:#4be6fa&quot;&gt;in&lt;/span&gt;);&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;N&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;sc.nextInt();&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ArrayList&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;lt;&lt;/span&gt;XY&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;arr&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;new&lt;/span&gt;&amp;nbsp;ArrayList&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;lt;&lt;/span&gt;XY&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;gt;&lt;/span&gt;();&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;for&lt;/span&gt;&amp;nbsp;(&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;0&lt;/span&gt;;&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;N;&amp;nbsp;i&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&amp;nbsp;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;x&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;sc.nextInt();&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;y&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;sc.nextInt();&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arr.&lt;span style=&quot;color:#4be6fa&quot;&gt;add&lt;/span&gt;(&lt;span style=&quot;color:#ff3399&quot;&gt;new&lt;/span&gt;&amp;nbsp;XY(x,&amp;nbsp;y));&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Collections.sort(arr,&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;new&lt;/span&gt;&amp;nbsp;Comparator&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;lt;&lt;/span&gt;XY&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;gt;&lt;/span&gt;()&amp;nbsp;{&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@Override&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;compare(XY&amp;nbsp;o1,&amp;nbsp;XY&amp;nbsp;o2)&amp;nbsp;{&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;if&lt;/span&gt;&amp;nbsp;(&amp;nbsp;o1.x&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;o2.x&amp;nbsp;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;return&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;else&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;if&lt;/span&gt;&amp;nbsp;(&amp;nbsp;o1.x&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;o2.x&amp;nbsp;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;return&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;else&lt;/span&gt;&amp;nbsp;{&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;if&lt;/span&gt;&amp;nbsp;(&amp;nbsp;o1.y&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;o2.y&amp;nbsp;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;return&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;else&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;if&lt;/span&gt;&amp;nbsp;(o1.y&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;o2.y&amp;nbsp;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;return&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;else&lt;/span&gt;&amp;nbsp;{&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;return&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;0&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;});&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;for&lt;/span&gt;&amp;nbsp;(&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;0&lt;/span&gt;;&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;arr.size();&amp;nbsp;i&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&amp;nbsp;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;System&lt;/span&gt;.&lt;span style=&quot;color:#4be6fa&quot;&gt;out&lt;/span&gt;.&lt;span style=&quot;color:#4be6fa&quot;&gt;println&lt;/span&gt;(arr.get(i).x&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ffd500&quot;&gt;&quot;&amp;nbsp;&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&amp;nbsp;arr.get(i).y);&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align:right; margin-top:-13px; margin-right:5px; font-size:9px; font-style:italic&quot;&gt;&lt;a href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; style=&quot;color: rgb(79, 79, 79);&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;vertical-align:bottom; padding:0 2px 4px 0&quot;&gt;&lt;a href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; style=&quot;color: white;&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: rgb(79, 79, 79); border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>Algorithm/Baekjoon Online Judge</category>
      <category>algorithm</category>
      <category>Baekjoon Online Judege</category>
      <category>boj</category>
      <category>java</category>
      <category>sort</category>
      <author>best</author>
      <guid isPermaLink="true">https://best421.tistory.com/122</guid>
      <comments>https://best421.tistory.com/122#entry122comment</comments>
      <pubDate>Mon, 24 Apr 2017 15:37:18 +0900</pubDate>
    </item>
    <item>
      <title>[정렬] BOJ_1431 시리얼 번호</title>
      <link>https://best421.tistory.com/121</link>
      <description>&lt;div id=&quot;problem-body&quot; style=&quot;box-sizing: border-box; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Noto Sans CJK KR&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, 나눔바른고딕, 나눔고딕, NanumGothic, 맑은고딕, &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, sans-serif; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;section id=&quot;description&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;문제&lt;/h2&gt;&lt;/div&gt;&lt;div id=&quot;problem_description&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; font-size: medium; line-height: 30px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;다솜이는 기타를 많이 가지고 있다. 그리고 각각의 기타는 모두 다른 시리얼 번호를 가지고 있다. 다솜이는 기타를 빨리 찾아서 빨리 사람들에게 연주해주기 위해서 기타를 시리얼 번호 순서대로 정렬하고자 한다.&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;모든 시리얼 번호는 알파벳 대문자 (A-Z)와 숫자 (0-9)로 이루어져 있다.&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;시리얼번호 A가 시리얼번호 B의 앞에 오는는 경우는 다음과 같다.&lt;/p&gt;&lt;ol style=&quot;box-sizing: border-box; border-radius: 0px !important; margin-top: 0px; margin-bottom: 10px;&quot;&gt;&lt;li style=&quot;box-sizing: border-box; border-radius: 0px !important; color: rgb(85, 85, 85);&quot;&gt;A와 B의 길이가 다르면, 짧은 것이 먼저 온다.&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; border-radius: 0px !important; color: rgb(85, 85, 85);&quot;&gt;만약 서로 길이가 같다면, A의 모든 자리수의 합과 B의 모든 자리수의 합을 비교해서 작은 합을 가지는 것이 먼저온다. (숫자인 것만 더한다)&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; border-radius: 0px !important; color: rgb(85, 85, 85);&quot;&gt;만약 1,2번 둘 조건으로도 비교할 수 없으면, 사전순으로 비교한다. 숫자가 알파벳보다 사전순으로 작다.&lt;/li&gt;&lt;/ol&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;시리얼이 주어졌을 때, 정렬해서 출력하는 프로그램을 작성하시오.&lt;/p&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;section id=&quot;input&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;입력&lt;/h2&gt;&lt;/div&gt;&lt;div id=&quot;problem_input&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; font-size: medium; line-height: 30px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;첫째 줄에 기타의 개수 N이 주어진다. N은 1,000보다 작거나 같다. 둘째 줄부터 N개의 줄에 시리얼 번호가 하나씩 주어진다. 시리얼 번호의 길이는 최대 50이고, 알파벳 대문자 또는 숫자로만 이루어져 있다. 시리얼 번호는 중복되지 않는다.&lt;/p&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;section id=&quot;output&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;출력&lt;/h2&gt;&lt;/div&gt;&lt;div id=&quot;problem_output&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; font-size: medium; line-height: 30px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;첫째 줄부터 차례대로 N개의 줄에 한줄에 하나씩 시리얼 번호를 정렬한 결과를 출력한다.&lt;/p&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;div class=&quot;row&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; margin-right: -15px; margin-left: -15px;&quot;&gt;&lt;div class=&quot;col-md-6&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;section id=&quot;sampleinput&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;예제 입력&amp;nbsp;&lt;button type=&quot;button&quot; class=&quot;btn btn-link copy-button no-print&quot; data-clipboard-target=&quot;#sample-input-1&quot; style=&quot;border-radius: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 14px; line-height: 1.42857; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Noto Sans CJK KR&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, 나눔바른고딕, 나눔고딕, NanumGothic, 맑은고딕, &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, sans-serif; color: rgb(66, 139, 202); overflow: visible; cursor: pointer; text-align: center; white-space: nowrap; vertical-align: middle; user-select: none; background-image: none; border-width: 1px; border-style: solid; border-color: transparent; box-shadow: none; outline: 0px !important;&quot;&gt;복사&lt;/button&gt;&lt;/h2&gt;&lt;/div&gt;&lt;pre class=&quot;sampledata&quot; id=&quot;sample-input-1&quot; style=&quot;box-sizing: border-box; border-radius: 5px; overflow-x: scroll; overflow-y: auto; font-family: Menlo, Monaco, &amp;quot;Source Code Pro&amp;quot;, consolas, monospace; font-size: 18px; padding: 8px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; word-break: normal; word-wrap: normal; background-color: rgb(247, 247, 249); border: 1px solid rgb(225, 225, 232);&quot;&gt;5
ABCD
145C
A
A910
Z321
&lt;/pre&gt;&lt;/section&gt;&lt;/div&gt;&lt;div class=&quot;col-md-6&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;section id=&quot;sampleoutput&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;예제 출력&amp;nbsp;&lt;button type=&quot;button&quot; class=&quot;btn btn-link copy-button no-print&quot; data-clipboard-target=&quot;#sample-output-1&quot; style=&quot;border-radius: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 14px; line-height: 1.42857; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Noto Sans CJK KR&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, 나눔바른고딕, 나눔고딕, NanumGothic, 맑은고딕, &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, sans-serif; color: rgb(66, 139, 202); overflow: visible; cursor: pointer; text-align: center; white-space: nowrap; vertical-align: middle; user-select: none; background-image: none; border-width: 1px; border-style: solid; border-color: transparent; box-shadow: none; outline: 0px !important;&quot;&gt;복사&lt;/button&gt;&lt;/h2&gt;&lt;/div&gt;&lt;pre class=&quot;sampledata&quot; id=&quot;sample-output-1&quot; style=&quot;box-sizing: border-box; border-radius: 5px; overflow-x: scroll; overflow-y: auto; font-family: Menlo, Monaco, &amp;quot;Source Code Pro&amp;quot;, consolas, monospace; font-size: 18px; padding: 8px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; word-break: normal; word-wrap: normal; background-color: rgb(247, 247, 249); border: 1px solid rgb(225, 225, 232);&quot;&gt;A
ABCD
Z321
145C
A910
&lt;/pre&gt;&lt;/section&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;section id=&quot;hint&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;코드&lt;/h2&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Noto Sans CJK KR&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, 나눔바른고딕, 나눔고딕, NanumGothic, 맑은고딕, &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, sans-serif; border-radius: 0px !important;&quot;&gt;&lt;section id=&quot;source&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;br /&gt;&lt;/section&gt;&lt;section id=&quot;source&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;colorscripter-code&quot; style=&quot;color:#f0f0f0; font-family:Monaco !important; position:relative !important; overflow:auto&quot;&gt;&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin:0; padding:0; border:none; background-color:#272727; border-radius:4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;padding:6px; border-right:2px solid #4f4f4f&quot;&gt;&lt;div style=&quot;margin:0; padding:0; word-break:normal; text-align:right; color:#aaa; font-family:Monaco !important; line-height:130%&quot;&gt;&lt;div style=&quot;line-height:130%&quot;&gt;1&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;2&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;3&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;4&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;5&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;6&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;7&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;8&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;9&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;10&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;11&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;12&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;13&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;14&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;15&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;16&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;17&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;18&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;19&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;20&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;21&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;22&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;23&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;24&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;25&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;26&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;27&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;28&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;29&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;30&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;31&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;32&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;33&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;34&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;35&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;36&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;37&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;38&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;39&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;40&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;41&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;42&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;43&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;44&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;45&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;46&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;47&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;48&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;49&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;50&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;51&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;52&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;53&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;54&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;55&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;56&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;57&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;58&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;59&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;60&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;61&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;62&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;63&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;64&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;65&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;66&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;67&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;68&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;69&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;70&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;71&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;72&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;padding:6px 0&quot;&gt;&lt;div style=&quot;margin:0; padding:0; color:#f0f0f0; font-family:Monaco !important; line-height:130%&quot;&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;package&lt;/span&gt;&amp;nbsp;sort;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;import&lt;/span&gt;&amp;nbsp;java.util.Arrays;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;import&lt;/span&gt;&amp;nbsp;java.util.Comparator;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;import&lt;/span&gt;&amp;nbsp;java.util.&lt;span style=&quot;color:#4be6fa&quot;&gt;Scanner&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;/**&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;&amp;nbsp;*&amp;nbsp;https://www.acmicpc.net/problem/1431&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;&amp;nbsp;*&amp;nbsp;시리얼&amp;nbsp;번호&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;&amp;nbsp;*&amp;nbsp;@author&amp;nbsp;minjung&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;&amp;nbsp;*/&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;class&lt;/span&gt;&amp;nbsp;baekjoon_1431&amp;nbsp;{&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;static&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;void&lt;/span&gt;&amp;nbsp;main(&lt;span style=&quot;color:#4be6fa&quot;&gt;String&lt;/span&gt;[]&amp;nbsp;args)&amp;nbsp;{&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#999999&quot;&gt;//&amp;nbsp;길이가&amp;nbsp;짧은&amp;nbsp;것,&amp;nbsp;A의&amp;nbsp;모든&amp;nbsp;자리수의&amp;nbsp;합과&amp;nbsp;B의&amp;nbsp;모든&amp;nbsp;자리수의&amp;nbsp;합&amp;nbsp;중&amp;nbsp;작은&amp;nbsp;합,&amp;nbsp;사전순(숫자가&amp;nbsp;알파벳보다&amp;nbsp;사전순으로&amp;nbsp;작다.)&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;Scanner&lt;/span&gt;&amp;nbsp;sc&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;Scanner&lt;/span&gt;(&lt;span style=&quot;color:#4be6fa&quot;&gt;System&lt;/span&gt;.&lt;span style=&quot;color:#4be6fa&quot;&gt;in&lt;/span&gt;);&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;N&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;sc.nextInt();&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;String&lt;/span&gt;[]&amp;nbsp;guitar&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;String&lt;/span&gt;[N&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;];&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;for&lt;/span&gt;&amp;nbsp;(&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;0&lt;/span&gt;;&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;N;&amp;nbsp;i&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&amp;nbsp;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;String&lt;/span&gt;&amp;nbsp;serial&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;sc.nextLine();&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;guitar[i]&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;serial;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Arrays.sort(guitar,&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;new&lt;/span&gt;&amp;nbsp;Comparator&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#4be6fa&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;gt;&lt;/span&gt;(){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@Override&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;compare(&lt;span style=&quot;color:#4be6fa&quot;&gt;String&lt;/span&gt;&amp;nbsp;o1,&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;String&lt;/span&gt;&amp;nbsp;o2)&amp;nbsp;{&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;if&lt;/span&gt;&amp;nbsp;(&amp;nbsp;o1.&lt;span style=&quot;color:#4be6fa&quot;&gt;length&lt;/span&gt;()&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;o2.&lt;span style=&quot;color:#4be6fa&quot;&gt;length&lt;/span&gt;()&amp;nbsp;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;return&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;else&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;if&lt;/span&gt;&amp;nbsp;(&amp;nbsp;o1.&lt;span style=&quot;color:#4be6fa&quot;&gt;length&lt;/span&gt;()&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;o2.&lt;span style=&quot;color:#4be6fa&quot;&gt;length&lt;/span&gt;()&amp;nbsp;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;return&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;else&lt;/span&gt;&amp;nbsp;{&amp;nbsp;&lt;span style=&quot;color:#999999&quot;&gt;//&amp;nbsp;길이가&amp;nbsp;같다면&amp;nbsp;자리수의&amp;nbsp;합&amp;nbsp;비교&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;sum&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;0&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;for&lt;/span&gt;&amp;nbsp;(&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;0&lt;/span&gt;;&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;o1.&lt;span style=&quot;color:#4be6fa&quot;&gt;length&lt;/span&gt;();&amp;nbsp;i&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&amp;nbsp;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;char&lt;/span&gt;&amp;nbsp;result&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;o1.&lt;span style=&quot;color:#4be6fa&quot;&gt;substring&lt;/span&gt;(i,&amp;nbsp;i&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;).&lt;span style=&quot;color:#4be6fa&quot;&gt;charAt&lt;/span&gt;(&lt;span style=&quot;color:#c10aff&quot;&gt;0&lt;/span&gt;);&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;if&lt;/span&gt;&amp;nbsp;(&amp;nbsp;(&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;)result&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;47&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;amp;&lt;/span&gt;&amp;nbsp;(&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;)result&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;58&lt;/span&gt;)&amp;nbsp;{&amp;nbsp;&lt;span style=&quot;color:#999999&quot;&gt;//&amp;nbsp;숫자라면&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sum&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;Integer.&lt;span style=&quot;color:#4be6fa&quot;&gt;parseInt&lt;/span&gt;(Character.&lt;span style=&quot;color:#4be6fa&quot;&gt;toString&lt;/span&gt;(result));&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;sum2&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;0&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;for&lt;/span&gt;&amp;nbsp;(&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;j&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;0&lt;/span&gt;;&amp;nbsp;j&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;o2.&lt;span style=&quot;color:#4be6fa&quot;&gt;length&lt;/span&gt;();&amp;nbsp;j&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&amp;nbsp;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;char&lt;/span&gt;&amp;nbsp;result&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;o2.&lt;span style=&quot;color:#4be6fa&quot;&gt;substring&lt;/span&gt;(j,&amp;nbsp;j&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;).&lt;span style=&quot;color:#4be6fa&quot;&gt;charAt&lt;/span&gt;(&lt;span style=&quot;color:#c10aff&quot;&gt;0&lt;/span&gt;);&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;if&lt;/span&gt;&amp;nbsp;(&amp;nbsp;(&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;)result&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;47&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;amp;&lt;/span&gt;&amp;nbsp;(&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;)result&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;58&lt;/span&gt;)&amp;nbsp;{&amp;nbsp;&lt;span style=&quot;color:#999999&quot;&gt;//&amp;nbsp;숫자라면&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sum2&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;Integer.&lt;span style=&quot;color:#4be6fa&quot;&gt;parseInt&lt;/span&gt;(Character.&lt;span style=&quot;color:#4be6fa&quot;&gt;toString&lt;/span&gt;(result));&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;if&lt;/span&gt;&amp;nbsp;(&amp;nbsp;sum&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;sum2&amp;nbsp;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;return&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;else&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;if&lt;/span&gt;&amp;nbsp;(&amp;nbsp;sum&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;sum2){&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;return&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;else&lt;/span&gt;&amp;nbsp;{&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;return&lt;/span&gt;&amp;nbsp;o1.compareTo(o2);&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;});&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;for&lt;/span&gt;(&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;;&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;guitar.&lt;span style=&quot;color:#4be6fa&quot;&gt;length&lt;/span&gt;;&amp;nbsp;i&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&amp;nbsp;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;System&lt;/span&gt;.&lt;span style=&quot;color:#4be6fa&quot;&gt;out&lt;/span&gt;.&lt;span style=&quot;color:#4be6fa&quot;&gt;println&lt;/span&gt;(guitar[i]);&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align:right; margin-top:-13px; margin-right:5px; font-size:9px; font-style:italic&quot;&gt;&lt;a href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; style=&quot;color: rgb(79, 79, 79);&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;vertical-align:bottom; padding:0 2px 4px 0&quot;&gt;&lt;a href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; style=&quot;color: white;&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: rgb(79, 79, 79); border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>Algorithm/Baekjoon Online Judge</category>
      <category>algorithm</category>
      <category>Baekjoon Online Judege</category>
      <category>boj</category>
      <category>java</category>
      <category>sort</category>
      <author>best</author>
      <guid isPermaLink="true">https://best421.tistory.com/121</guid>
      <comments>https://best421.tistory.com/121#entry121comment</comments>
      <pubDate>Mon, 24 Apr 2017 15:34:48 +0900</pubDate>
    </item>
    <item>
      <title>[다이나믹 프로그래밍] BOJ_2293 동전1</title>
      <link>https://best421.tistory.com/120</link>
      <description>&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Noto Sans CJK KR&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, 나눔바른고딕, 나눔고딕, NanumGothic, 맑은고딕, &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, sans-serif; border-radius: 0px !important;&quot;&gt;&lt;section id=&quot;description&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;문제&lt;/h2&gt;&lt;/div&gt;&lt;div id=&quot;problem_description&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; font-size: medium; line-height: 30px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;n가지 종류의 동전이 있다. 각각의 동전이 나타내는 가치는 다르다. 이 동전들을 적당히 사용해서, 그 가치의 합이 k원이 되도록 하고 싶다. 그 경우의 수를 구하시오. (각각의 동전은 몇 개라도 사용할 수 있다.)&lt;/p&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Noto Sans CJK KR&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, 나눔바른고딕, 나눔고딕, NanumGothic, 맑은고딕, &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, sans-serif; border-radius: 0px !important;&quot;&gt;&lt;section id=&quot;input&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;입력&lt;/h2&gt;&lt;/div&gt;&lt;div id=&quot;problem_input&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; font-size: medium; line-height: 30px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;첫째줄에 n, k가 주어진다. (1 ≤ n ≤ 100, 1 ≤&amp;nbsp;k ≤ 10,000) 다음 n개의 줄에는 각각의 동전의 가치가 주어진다.&lt;/p&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Noto Sans CJK KR&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, 나눔바른고딕, 나눔고딕, NanumGothic, 맑은고딕, &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, sans-serif; border-radius: 0px !important;&quot;&gt;&lt;section id=&quot;output&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;출력&lt;/h2&gt;&lt;/div&gt;&lt;div id=&quot;problem_output&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; font-size: medium; line-height: 30px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;첫째 줄에 경우의 수를 출력한다. 경우의 수는 2^31보다 작다.&lt;/p&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Noto Sans CJK KR&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, 나눔바른고딕, 나눔고딕, NanumGothic, 맑은고딕, &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, sans-serif; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;row&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; margin-right: -15px; margin-left: -15px;&quot;&gt;&lt;div class=&quot;col-md-6&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;section id=&quot;sampleinput&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;예제 입력&amp;nbsp;&lt;button type=&quot;button&quot; class=&quot;btn btn-link copy-button no-print&quot; data-clipboard-target=&quot;#sample-input-1&quot; style=&quot;border-radius: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 14px; line-height: 1.42857; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Noto Sans CJK KR&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, 나눔바른고딕, 나눔고딕, NanumGothic, 맑은고딕, &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, sans-serif; color: rgb(66, 139, 202); overflow: visible; cursor: pointer; text-align: center; white-space: nowrap; vertical-align: middle; user-select: none; background-image: none; border-width: 1px; border-style: solid; border-color: transparent; box-shadow: none; outline: 0px !important;&quot;&gt;복사&lt;/button&gt;&lt;/h2&gt;&lt;/div&gt;&lt;pre class=&quot;sampledata&quot; id=&quot;sample-input-1&quot; style=&quot;box-sizing: border-box; border-radius: 5px; overflow-x: scroll; overflow-y: auto; font-family: Menlo, Monaco, &amp;quot;Source Code Pro&amp;quot;, consolas, monospace; font-size: 18px; padding: 8px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; word-break: normal; word-wrap: normal; background-color: rgb(247, 247, 249); border: 1px solid rgb(225, 225, 232);&quot;&gt;3 10
1
2
5
&lt;/pre&gt;&lt;/section&gt;&lt;/div&gt;&lt;div class=&quot;col-md-6&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;section id=&quot;sampleoutput&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;예제 출력&amp;nbsp;&lt;button type=&quot;button&quot; class=&quot;btn btn-link copy-button no-print&quot; data-clipboard-target=&quot;#sample-output-1&quot; style=&quot;border-radius: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 14px; line-height: 1.42857; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Noto Sans CJK KR&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, 나눔바른고딕, 나눔고딕, NanumGothic, 맑은고딕, &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, sans-serif; color: rgb(66, 139, 202); overflow: visible; cursor: pointer; text-align: center; white-space: nowrap; vertical-align: middle; user-select: none; background-image: none; border-width: 1px; border-style: solid; border-color: transparent; box-shadow: none; outline: 0px !important;&quot;&gt;복사&lt;/button&gt;&lt;/h2&gt;&lt;/div&gt;&lt;pre class=&quot;sampledata&quot; id=&quot;sample-output-1&quot; style=&quot;box-sizing: border-box; border-radius: 5px; overflow-x: scroll; overflow-y: auto; font-family: Menlo, Monaco, &amp;quot;Source Code Pro&amp;quot;, consolas, monospace; font-size: 18px; padding: 8px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; word-break: normal; word-wrap: normal; background-color: rgb(247, 247, 249); border: 1px solid rgb(225, 225, 232);&quot;&gt;10
&lt;/pre&gt;&lt;/section&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Noto Sans CJK KR&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, 나눔바른고딕, 나눔고딕, NanumGothic, 맑은고딕, &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, sans-serif; border-radius: 0px !important;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;section id=&quot;hint&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;코드&lt;/h2&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Noto Sans CJK KR&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, 나눔바른고딕, 나눔고딕, NanumGothic, 맑은고딕, &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, sans-serif; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;colorscripter-code&quot; style=&quot;color:#f0f0f0; font-family:Monaco !important; position:relative !important; overflow:auto&quot;&gt;&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin:0; padding:0; border:none; background-color:#272727; border-radius:4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;padding:6px; border-right:2px solid #4f4f4f&quot;&gt;&lt;div style=&quot;margin:0; padding:0; word-break:normal; text-align:right; color:#aaa; font-family:Monaco !important; line-height:130%&quot;&gt;&lt;div style=&quot;line-height:130%&quot;&gt;1&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;2&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;3&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;4&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;5&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;6&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;7&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;8&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;9&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;10&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;11&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;12&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;13&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;14&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;15&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;16&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;17&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;18&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;19&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;20&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;21&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;22&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;23&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;24&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;25&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;26&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;27&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;28&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;29&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;30&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;31&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;32&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;33&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;34&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;35&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;36&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;37&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;38&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;39&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;40&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;41&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;padding:6px 0&quot;&gt;&lt;div style=&quot;margin:0; padding:0; color:#f0f0f0; font-family:Monaco !important; line-height:130%&quot;&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;package&lt;/span&gt;&amp;nbsp;dp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;import&lt;/span&gt;&amp;nbsp;java.util.Arrays;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;import&lt;/span&gt;&amp;nbsp;java.util.&lt;span style=&quot;color:#4be6fa&quot;&gt;Scanner&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;/**&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;&amp;nbsp;*&amp;nbsp;https://www.acmicpc.net/problem/2293&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;&amp;nbsp;*&amp;nbsp;동전&amp;nbsp;1&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;&amp;nbsp;*&amp;nbsp;@author&amp;nbsp;minjung&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;&amp;nbsp;*&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;&amp;nbsp;*/&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;class&lt;/span&gt;&amp;nbsp;baekjoon_2293&amp;nbsp;{&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;static&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;void&lt;/span&gt;&amp;nbsp;main(&lt;span style=&quot;color:#4be6fa&quot;&gt;String&lt;/span&gt;[]&amp;nbsp;args)&amp;nbsp;{&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#999999&quot;&gt;//&amp;nbsp;TODO&amp;nbsp;Auto-generated&amp;nbsp;method&amp;nbsp;stub&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;Scanner&lt;/span&gt;&amp;nbsp;sc&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;Scanner&lt;/span&gt;(&lt;span style=&quot;color:#4be6fa&quot;&gt;System&lt;/span&gt;.&lt;span style=&quot;color:#4be6fa&quot;&gt;in&lt;/span&gt;);&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;n&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;sc.nextInt();&amp;nbsp;&lt;span style=&quot;color:#999999&quot;&gt;//&amp;nbsp;n가지&amp;nbsp;종류&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;k&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;sc.nextInt();&amp;nbsp;&lt;span style=&quot;color:#999999&quot;&gt;//&amp;nbsp;합이&amp;nbsp;k원&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;[]&amp;nbsp;coin&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;[n&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;];&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;for&lt;/span&gt;&amp;nbsp;(&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;;&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;n;&amp;nbsp;i&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&amp;nbsp;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;coin[i]&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;sc.nextInt();&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Arrays.sort(coin);&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;[]&amp;nbsp;dp&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;[k&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;];&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dp[&lt;span style=&quot;color:#c10aff&quot;&gt;0&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;for&lt;/span&gt;&amp;nbsp;(&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;;&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;n;&amp;nbsp;i&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&amp;nbsp;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;for&lt;/span&gt;&amp;nbsp;(&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;j&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;coin[i];&amp;nbsp;j&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;k;&amp;nbsp;j&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&amp;nbsp;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dp[j]&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;dp[j&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;-&lt;/span&gt;&amp;nbsp;coin[i]];&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;System&lt;/span&gt;.&lt;span style=&quot;color:#4be6fa&quot;&gt;out&lt;/span&gt;.&lt;span style=&quot;color:#4be6fa&quot;&gt;println&lt;/span&gt;(dp[k]);&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align:right; margin-top:-13px; margin-right:5px; font-size:9px; font-style:italic&quot;&gt;&lt;a href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; style=&quot;color: rgb(79, 79, 79);&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;vertical-align:bottom; padding:0 2px 4px 0&quot;&gt;&lt;a href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; style=&quot;color: white;&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: rgb(79, 79, 79); border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>Algorithm/Baekjoon Online Judge</category>
      <author>best</author>
      <guid isPermaLink="true">https://best421.tistory.com/120</guid>
      <comments>https://best421.tistory.com/120#entry120comment</comments>
      <pubDate>Fri, 21 Apr 2017 10:53:25 +0900</pubDate>
    </item>
    <item>
      <title>[다이나믹 프로그래밍] BOJ_3943 헤일스톤 수열</title>
      <link>https://best421.tistory.com/119</link>
      <description>&lt;div id=&quot;problem-body&quot; style=&quot;box-sizing: border-box; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Noto Sans CJK KR&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, 나눔바른고딕, 나눔고딕, NanumGothic, 맑은고딕, &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, sans-serif; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;section id=&quot;description&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;문제&lt;/h2&gt;&lt;/div&gt;&lt;div id=&quot;problem_description&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; font-size: medium; line-height: 30px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;헤일스톤 수열은 다음과 같이 정의 한다.&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;- n이 짝수라면, 2로 나눈다.&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;- n이 홀수라면, 3을 곱한 뒤 1로 더한다.&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;헤일스톤 추측은 임의의 양의 정수 n으로 수열을 시작한다면, 항상 4, 2, 1, 4, 2, 1,...로 끝난다는 추측이다. 이 문제에서는 1이 나오면 수열이 끝난 것으로 처리한다.&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;n이 주어졌을 때, 이 수열에서 가장 큰 값을 찾아 출력하는 프로그램을 작성하시오.&lt;/p&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;section id=&quot;input&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;입력&lt;/h2&gt;&lt;/div&gt;&lt;div id=&quot;problem_input&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; font-size: medium; line-height: 30px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;첫째 줄에 테스트 케이스의 개수 T(1 ≤ T ≤ 100,000)가 주어진다. 다음 줄부터 T개의 줄에는 헤일스톤 수열의 시작값 n이 주어진다. (1 ≤ n ≤ 100,000)&lt;/p&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;section id=&quot;output&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;출력&lt;/h2&gt;&lt;/div&gt;&lt;div id=&quot;problem_output&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; font-size: medium; line-height: 30px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;각각의 테스트 케이스에 대해서, n으로 시작하는 헤일스톤 수열에서 가장 큰 값을 출력한다.&lt;/p&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;div class=&quot;row&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; margin-right: -15px; margin-left: -15px;&quot;&gt;&lt;div class=&quot;col-md-6&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;section id=&quot;sampleinput&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;예제 입력&amp;nbsp;&lt;button type=&quot;button&quot; class=&quot;btn btn-link copy-button no-print&quot; data-clipboard-target=&quot;#sample-input-1&quot; style=&quot;border-radius: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 14px; line-height: 1.42857; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Noto Sans CJK KR&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, 나눔바른고딕, 나눔고딕, NanumGothic, 맑은고딕, &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, sans-serif; color: rgb(66, 139, 202); overflow: visible; cursor: pointer; text-align: center; white-space: nowrap; vertical-align: middle; user-select: none; background-image: none; border-width: 1px; border-style: solid; border-color: transparent; box-shadow: none; outline: 0px !important;&quot;&gt;복사&lt;/button&gt;&lt;/h2&gt;&lt;/div&gt;&lt;pre class=&quot;sampledata&quot; id=&quot;sample-input-1&quot; style=&quot;box-sizing: border-box; border-radius: 5px; overflow-x: scroll; overflow-y: auto; font-family: Menlo, Monaco, &amp;quot;Source Code Pro&amp;quot;, consolas, monospace; font-size: 18px; padding: 8px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; word-break: normal; word-wrap: normal; background-color: rgb(247, 247, 249); border: 1px solid rgb(225, 225, 232);&quot;&gt;4
1
3
9999
100000
&lt;/pre&gt;&lt;/section&gt;&lt;/div&gt;&lt;div class=&quot;col-md-6&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;section id=&quot;sampleoutput&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;예제 출력&amp;nbsp;&lt;button type=&quot;button&quot; class=&quot;btn btn-link copy-button no-print&quot; data-clipboard-target=&quot;#sample-output-1&quot; style=&quot;border-radius: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 14px; line-height: 1.42857; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Noto Sans CJK KR&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, 나눔바른고딕, 나눔고딕, NanumGothic, 맑은고딕, &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, sans-serif; color: rgb(66, 139, 202); overflow: visible; cursor: pointer; text-align: center; white-space: nowrap; vertical-align: middle; user-select: none; background-image: none; border-width: 1px; border-style: solid; border-color: transparent; box-shadow: none; outline: 0px !important;&quot;&gt;복사&lt;/button&gt;&lt;/h2&gt;&lt;/div&gt;&lt;pre class=&quot;sampledata&quot; id=&quot;sample-output-1&quot; style=&quot;box-sizing: border-box; border-radius: 5px; overflow-x: scroll; overflow-y: auto; font-family: Menlo, Monaco, &amp;quot;Source Code Pro&amp;quot;, consolas, monospace; font-size: 18px; padding: 8px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; word-break: normal; word-wrap: normal; background-color: rgb(247, 247, 249); border: 1px solid rgb(225, 225, 232);&quot;&gt;1
16
101248
100000
&lt;/pre&gt;&lt;/section&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;section id=&quot;hint&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;코드&lt;/h2&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Noto Sans CJK KR&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, 나눔바른고딕, 나눔고딕, NanumGothic, 맑은고딕, &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, sans-serif; border-radius: 0px !important;&quot;&gt;&lt;section id=&quot;source&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;colorscripter-code&quot; style=&quot;color:#f0f0f0; font-family:Monaco !important; position:relative !important; overflow:auto&quot;&gt;&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin:0; padding:0; border:none; background-color:#272727; border-radius:4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;padding:6px; border-right:2px solid #4f4f4f&quot;&gt;&lt;div style=&quot;margin:0; padding:0; word-break:normal; text-align:right; color:#aaa; font-family:Monaco !important; line-height:130%&quot;&gt;&lt;div style=&quot;line-height:130%&quot;&gt;1&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;2&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;3&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;4&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;5&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;6&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;7&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;8&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;9&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;10&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;11&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;12&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;13&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;14&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;15&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;16&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;17&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;18&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;19&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;20&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;21&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;22&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;23&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;24&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;25&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;26&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;27&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;28&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;29&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;30&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;31&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;32&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;33&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;34&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;35&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;36&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;37&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;38&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;39&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;40&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;41&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;42&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;43&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;44&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;45&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;46&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;padding:6px 0&quot;&gt;&lt;div style=&quot;margin:0; padding:0; color:#f0f0f0; font-family:Monaco !important; line-height:130%&quot;&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;package&lt;/span&gt;&amp;nbsp;dp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;import&lt;/span&gt;&amp;nbsp;java.util.&lt;span style=&quot;color:#4be6fa&quot;&gt;Scanner&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;/**&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;&amp;nbsp;*&amp;nbsp;https://www.acmicpc.net/problem/3943&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;&amp;nbsp;*&amp;nbsp;헤일스톤&amp;nbsp;수열&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;&amp;nbsp;*&amp;nbsp;@author&amp;nbsp;minjung&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;&amp;nbsp;*&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;&amp;nbsp;*/&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;class&lt;/span&gt;&amp;nbsp;baekjoon_3943&amp;nbsp;{&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;static&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;void&lt;/span&gt;&amp;nbsp;main(&lt;span style=&quot;color:#4be6fa&quot;&gt;String&lt;/span&gt;[]&amp;nbsp;args)&amp;nbsp;{&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#999999&quot;&gt;//&amp;nbsp;TODO&amp;nbsp;Auto-generated&amp;nbsp;method&amp;nbsp;stub&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;Scanner&lt;/span&gt;&amp;nbsp;sc&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;Scanner&lt;/span&gt;(&lt;span style=&quot;color:#4be6fa&quot;&gt;System&lt;/span&gt;.&lt;span style=&quot;color:#4be6fa&quot;&gt;in&lt;/span&gt;);&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;T&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;sc.nextInt();&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;for&lt;/span&gt;&amp;nbsp;(&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;0&lt;/span&gt;;&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;T;&amp;nbsp;i&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&amp;nbsp;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;hailstone&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;sc.nextInt();&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;max&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;0&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;max&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;hailstone;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;while&lt;/span&gt;(&amp;nbsp;hailstone&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;&amp;nbsp;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;if&lt;/span&gt;&amp;nbsp;(&amp;nbsp;max&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;hailstone&amp;nbsp;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;max&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;hailstone;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;if&lt;/span&gt;&amp;nbsp;(&amp;nbsp;hailstone&amp;nbsp;%&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;2&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;0&lt;/span&gt;&amp;nbsp;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;hailstone&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;hailstone&lt;span style=&quot;color:#ff3399&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color:#c10aff&quot;&gt;2&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;else&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;if&lt;/span&gt;&amp;nbsp;(&amp;nbsp;hailstone&amp;nbsp;%&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;2&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;0&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;amp;&lt;/span&gt;&amp;nbsp;hailstone&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;&amp;nbsp;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;hailstone&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;hailstone&lt;span style=&quot;color:#ff3399&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color:#c10aff&quot;&gt;3&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;System&lt;/span&gt;.&lt;span style=&quot;color:#4be6fa&quot;&gt;out&lt;/span&gt;.&lt;span style=&quot;color:#4be6fa&quot;&gt;println&lt;/span&gt;(max);&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align:right; margin-top:-13px; margin-right:5px; font-size:9px; font-style:italic&quot;&gt;&lt;a href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; style=&quot;color: rgb(79, 79, 79);&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;vertical-align:bottom; padding:0 2px 4px 0&quot;&gt;&lt;a href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; style=&quot;color: white;&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: rgb(79, 79, 79); border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>Algorithm/Baekjoon Online Judge</category>
      <category>algorithm</category>
      <category>Baekjoon Online Judege</category>
      <category>boj</category>
      <category>DP</category>
      <category>java</category>
      <author>best</author>
      <guid isPermaLink="true">https://best421.tistory.com/119</guid>
      <comments>https://best421.tistory.com/119#entry119comment</comments>
      <pubDate>Thu, 20 Apr 2017 17:15:32 +0900</pubDate>
    </item>
    <item>
      <title>[다이나믹 프로그래밍] BOJ_2156 포도주 시식</title>
      <link>https://best421.tistory.com/118</link>
      <description>&lt;div id=&quot;problem-body&quot; style=&quot;box-sizing: border-box; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Noto Sans CJK KR&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, 나눔바른고딕, 나눔고딕, NanumGothic, 맑은고딕, &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, sans-serif; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;section id=&quot;description&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;문제&lt;/h2&gt;&lt;/div&gt;&lt;div id=&quot;problem_description&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; font-size: medium; line-height: 30px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;효주는 포도주 시식회에 갔다. 그 곳에 갔더니, 테이블 위에 다양한 포도주가 들어있는 포도주 잔이 일렬로 놓여 있었다. 효주는 포도주 시식을 하려고 하는데, 여기에는 다음과 같은 두 가지 규칙이 있다.&lt;/p&gt;&lt;ol style=&quot;box-sizing: border-box; border-radius: 0px !important; margin-top: 0px; margin-bottom: 10px;&quot;&gt;&lt;li style=&quot;box-sizing: border-box; border-radius: 0px !important; color: rgb(85, 85, 85);&quot;&gt;포도주 잔을 선택하면 그 잔에 들어있는 포도주는 모두 마셔야 하고, 마신 후에는 원래 위치에 다시 놓아야 한다.&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; border-radius: 0px !important; color: rgb(85, 85, 85);&quot;&gt;연속으로 놓여 있는 3잔을 모두 마실 수는 없다.&lt;/li&gt;&lt;/ol&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;효주는 될 수 있는 대로 많은 양의 포도주를 맛보기 위해서 어떤 포도주 잔을 선택해야 할지 고민하고 있다. 1부터 n까지의 번호가 붙어 있는 n개의 포도주 잔이 순서대로 테이블 위에 놓여 있고, 각 포도주 잔에 들어있는 포도주의 양이 주어졌을 때, 효주를 도와 가장 많은 양의 포도주를 마실 수 있도록 하는 프로그램을 작성하시오.&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;예를 들어 6개의 포도주 잔이 있고, 각각의 잔에 순서대로 6, 10, 13, 9, 8, 1 만큼의 포도주가 들어 있을 때, 첫 번째, 두 번째, 네 번째, 다섯 번째 포도주 잔을 선택하면 총 포도주 양이 33으로 최대로 마실 수 있다.&lt;/p&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;section id=&quot;input&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;입력&lt;/h2&gt;&lt;/div&gt;&lt;div id=&quot;problem_input&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; font-size: medium; line-height: 30px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;첫째 줄에 포도주 잔의 개수 n이 주어진다. (1≤n≤10,000) 둘째 줄부터 n+1번째 줄까지 포도주 잔에 들어있는 포도주의 양이 순서대로 주어진다. 포도주의 양은 1,000 이하의 정수이다.&lt;/p&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;section id=&quot;output&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;출력&lt;/h2&gt;&lt;/div&gt;&lt;div id=&quot;problem_output&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; font-size: medium; line-height: 30px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;첫째 줄에 최대로 마실 수 있는 포도주의 양을 출력한다.&lt;/p&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;div class=&quot;row&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; margin-right: -15px; margin-left: -15px;&quot;&gt;&lt;div class=&quot;col-md-6&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;section id=&quot;sampleinput&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;예제 입력&amp;nbsp;&lt;button type=&quot;button&quot; class=&quot;btn btn-link copy-button no-print&quot; data-clipboard-target=&quot;#sample-input-1&quot; style=&quot;border-radius: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 14px; line-height: 1.42857; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Noto Sans CJK KR&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, 나눔바른고딕, 나눔고딕, NanumGothic, 맑은고딕, &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, sans-serif; color: rgb(66, 139, 202); overflow: visible; cursor: pointer; text-align: center; white-space: nowrap; vertical-align: middle; user-select: none; background-image: none; border-width: 1px; border-style: solid; border-color: transparent; box-shadow: none; outline: 0px !important;&quot;&gt;복사&lt;/button&gt;&lt;/h2&gt;&lt;/div&gt;&lt;pre class=&quot;sampledata&quot; id=&quot;sample-input-1&quot; style=&quot;box-sizing: border-box; border-radius: 5px; overflow-x: scroll; overflow-y: auto; font-family: Menlo, Monaco, &amp;quot;Source Code Pro&amp;quot;, consolas, monospace; font-size: 18px; padding: 8px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; word-break: normal; word-wrap: normal; background-color: rgb(247, 247, 249); border: 1px solid rgb(225, 225, 232);&quot;&gt;6
6
10
13
9
8
1
&lt;/pre&gt;&lt;/section&gt;&lt;/div&gt;&lt;div class=&quot;col-md-6&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;section id=&quot;sampleoutput&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;예제 출력&amp;nbsp;&lt;button type=&quot;button&quot; class=&quot;btn btn-link copy-button no-print&quot; data-clipboard-target=&quot;#sample-output-1&quot; style=&quot;border-radius: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 14px; line-height: 1.42857; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Noto Sans CJK KR&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, 나눔바른고딕, 나눔고딕, NanumGothic, 맑은고딕, &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, sans-serif; color: rgb(66, 139, 202); overflow: visible; cursor: pointer; text-align: center; white-space: nowrap; vertical-align: middle; user-select: none; background-image: none; border-width: 1px; border-style: solid; border-color: transparent; box-shadow: none; outline: 0px !important;&quot;&gt;복사&lt;/button&gt;&lt;/h2&gt;&lt;/div&gt;&lt;pre class=&quot;sampledata&quot; id=&quot;sample-output-1&quot; style=&quot;box-sizing: border-box; border-radius: 5px; overflow-x: scroll; overflow-y: auto; font-family: Menlo, Monaco, &amp;quot;Source Code Pro&amp;quot;, consolas, monospace; font-size: 18px; padding: 8px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; word-break: normal; word-wrap: normal; background-color: rgb(247, 247, 249); border: 1px solid rgb(225, 225, 232);&quot;&gt;33&lt;/pre&gt;&lt;/section&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;section id=&quot;hint&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;코드&lt;/h2&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Noto Sans CJK KR&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, 나눔바른고딕, 나눔고딕, NanumGothic, 맑은고딕, &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, sans-serif; border-radius: 0px !important;&quot;&gt;&lt;section id=&quot;problem_tags&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;colorscripter-code&quot; style=&quot;color:#f0f0f0; font-family:Monaco !important; position:relative !important; overflow:auto&quot;&gt;&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin:0; padding:0; border:none; background-color:#272727; border-radius:4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;padding:6px; border-right:2px solid #4f4f4f&quot;&gt;&lt;div style=&quot;margin:0; padding:0; word-break:normal; text-align:right; color:#aaa; font-family:Monaco !important; line-height:130%&quot;&gt;&lt;div style=&quot;line-height:130%&quot;&gt;1&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;2&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;3&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;4&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;5&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;6&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;7&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;8&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;9&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;10&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;11&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;12&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;13&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;14&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;15&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;16&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;17&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;18&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;19&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;20&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;21&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;22&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;23&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;24&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;25&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;26&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;27&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;28&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;29&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;30&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;31&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;32&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;33&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;34&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;35&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;36&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;37&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;38&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;39&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;40&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;41&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;42&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;43&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;44&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;45&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;46&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;47&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;48&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;49&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;50&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;padding:6px 0&quot;&gt;&lt;div style=&quot;margin:0; padding:0; color:#f0f0f0; font-family:Monaco !important; line-height:130%&quot;&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;package&lt;/span&gt;&amp;nbsp;dp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;import&lt;/span&gt;&amp;nbsp;java.util.&lt;span style=&quot;color:#4be6fa&quot;&gt;Scanner&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;/**&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;&amp;nbsp;*&amp;nbsp;https://www.acmicpc.net/problem/2156&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;&amp;nbsp;*&amp;nbsp;포두주&amp;nbsp;시식&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;&amp;nbsp;*&amp;nbsp;@author&amp;nbsp;minjung&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;&amp;nbsp;*/&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;class&lt;/span&gt;&amp;nbsp;baekjoon_2156&amp;nbsp;{&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;static&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;n;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;static&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;long&lt;/span&gt;[]&amp;nbsp;grape;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;static&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;long&lt;/span&gt;[]&amp;nbsp;dp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;static&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;void&lt;/span&gt;&amp;nbsp;main(&lt;span style=&quot;color:#4be6fa&quot;&gt;String&lt;/span&gt;[]&amp;nbsp;args)&amp;nbsp;{&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#999999&quot;&gt;//&amp;nbsp;TODO&amp;nbsp;Auto-generated&amp;nbsp;method&amp;nbsp;stub&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;Scanner&lt;/span&gt;&amp;nbsp;sc&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;Scanner&lt;/span&gt;(&lt;span style=&quot;color:#4be6fa&quot;&gt;System&lt;/span&gt;.&lt;span style=&quot;color:#4be6fa&quot;&gt;in&lt;/span&gt;);&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;n&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;sc.nextInt();&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;grape&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;long&lt;/span&gt;[n&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;];&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dp&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;long&lt;/span&gt;[n&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;];&amp;nbsp;&lt;span style=&quot;color:#999999&quot;&gt;//&amp;nbsp;dp[n]은&amp;nbsp;n을&amp;nbsp;선택했을&amp;nbsp;때&amp;nbsp;최대로&amp;nbsp;마실&amp;nbsp;수&amp;nbsp;있는&amp;nbsp;포도주의&amp;nbsp;양&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;for&lt;/span&gt;&amp;nbsp;(&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;;&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;n;&amp;nbsp;i&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&amp;nbsp;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;grape[i]&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;sc.nextInt();&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#999999&quot;&gt;//연속으로&amp;nbsp;3잔&amp;nbsp;마실&amp;nbsp;수&amp;nbsp;없다.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dp[&lt;span style=&quot;color:#c10aff&quot;&gt;0&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;0&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dp[&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;grape[&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;];&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;if&lt;/span&gt;&amp;nbsp;(&amp;nbsp;n&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;2&lt;/span&gt;&amp;nbsp;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dp[&lt;span style=&quot;color:#c10aff&quot;&gt;2&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;dp[&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&amp;nbsp;grape[&lt;span style=&quot;color:#c10aff&quot;&gt;2&lt;/span&gt;];&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;for&lt;/span&gt;&amp;nbsp;(&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;3&lt;/span&gt;;&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;n;&amp;nbsp;i&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&amp;nbsp;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dp[i]&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;max(dp[i&lt;span style=&quot;color:#ff3399&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#c10aff&quot;&gt;2&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&amp;nbsp;grape[i],&amp;nbsp;dp[i&lt;span style=&quot;color:#ff3399&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#c10aff&quot;&gt;3&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&amp;nbsp;grape[i&lt;span style=&quot;color:#ff3399&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&amp;nbsp;grape[i]);&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dp[i]&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;max(dp[i&lt;span style=&quot;color:#ff3399&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;],&amp;nbsp;dp[i]);&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;System&lt;/span&gt;.&lt;span style=&quot;color:#4be6fa&quot;&gt;out&lt;/span&gt;.&lt;span style=&quot;color:#4be6fa&quot;&gt;println&lt;/span&gt;(dp[n]);&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;private&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;static&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;long&lt;/span&gt;&amp;nbsp;max(&lt;span style=&quot;color:#4be6fa&quot;&gt;long&lt;/span&gt;&amp;nbsp;i,&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;long&lt;/span&gt;&amp;nbsp;j)&amp;nbsp;{&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;if&lt;/span&gt;&amp;nbsp;(&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;j&amp;nbsp;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;return&lt;/span&gt;&amp;nbsp;i;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;else&lt;/span&gt;&amp;nbsp;{&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;return&lt;/span&gt;&amp;nbsp;j;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;}&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align:right; margin-top:-13px; margin-right:5px; font-size:9px; font-style:italic&quot;&gt;&lt;a href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; style=&quot;color: rgb(79, 79, 79);&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;vertical-align:bottom; padding:0 2px 4px 0&quot;&gt;&lt;a href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; style=&quot;color: white;&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: rgb(79, 79, 79); border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>Algorithm/Baekjoon Online Judge</category>
      <category>algorithm</category>
      <category>Baekjoon Online Judege</category>
      <category>boj</category>
      <category>DP</category>
      <category>java</category>
      <author>best</author>
      <guid isPermaLink="true">https://best421.tistory.com/118</guid>
      <comments>https://best421.tistory.com/118#entry118comment</comments>
      <pubDate>Thu, 20 Apr 2017 17:08:41 +0900</pubDate>
    </item>
    <item>
      <title>[다이나믹 프로그래밍] BOJ_2225 합분해</title>
      <link>https://best421.tistory.com/117</link>
      <description>&lt;div id=&quot;problem-body&quot; style=&quot;box-sizing: border-box; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Noto Sans CJK KR&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, 나눔바른고딕, 나눔고딕, NanumGothic, 맑은고딕, &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, sans-serif; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;section id=&quot;description&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;문제&lt;/h2&gt;&lt;/div&gt;&lt;div id=&quot;problem_description&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; font-size: medium; line-height: 30px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;0부터 N까지의 정수 K개를 더해서 그 합이 N이 되는 경우의 수를 구하는 프로그램을 작성하시오.&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;덧셈의 순서가 바뀐 경우는 다른 경우로 센다(1+2와 2+1은 서로 다른 경우). 또한 한 개의 수를 여러 번 쓸 수도 있다.&lt;/p&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;section id=&quot;input&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;입력&lt;/h2&gt;&lt;/div&gt;&lt;div id=&quot;problem_input&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; font-size: medium; line-height: 30px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;첫째 줄에 두 정수 N(1≤N≤200), K(1≤K≤200)가 주어진다.&lt;/p&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;section id=&quot;output&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;출력&lt;/h2&gt;&lt;/div&gt;&lt;div id=&quot;problem_output&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; font-size: medium; line-height: 30px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; border-radius: 0px !important; margin: 0px 0px 10px; color: rgb(85, 85, 85);&quot;&gt;첫째 줄에 답을 1,000,000,000으로 나눈 나머지를 출력한다.&lt;/p&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;div class=&quot;row&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; margin-right: -15px; margin-left: -15px;&quot;&gt;&lt;div class=&quot;col-md-6&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;section id=&quot;sampleinput&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;예제 입력&amp;nbsp;&lt;button type=&quot;button&quot; class=&quot;btn btn-link copy-button no-print&quot; data-clipboard-target=&quot;#sample-input-1&quot; style=&quot;border-radius: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 14px; line-height: 1.42857; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Noto Sans CJK KR&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, 나눔바른고딕, 나눔고딕, NanumGothic, 맑은고딕, &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, sans-serif; color: rgb(66, 139, 202); overflow: visible; cursor: pointer; text-align: center; white-space: nowrap; vertical-align: middle; user-select: none; background-image: none; border-width: 1px; border-style: solid; border-color: transparent; box-shadow: none; outline: 0px !important;&quot;&gt;복사&lt;/button&gt;&lt;/h2&gt;&lt;/div&gt;&lt;pre class=&quot;sampledata&quot; id=&quot;sample-input-1&quot; style=&quot;box-sizing: border-box; border-radius: 5px; overflow-x: scroll; overflow-y: auto; font-family: Menlo, Monaco, &amp;quot;Source Code Pro&amp;quot;, consolas, monospace; font-size: 18px; padding: 8px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; word-break: normal; word-wrap: normal; background-color: rgb(247, 247, 249); border: 1px solid rgb(225, 225, 232);&quot;&gt;20 2
&lt;/pre&gt;&lt;/section&gt;&lt;/div&gt;&lt;div class=&quot;col-md-6&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;section id=&quot;sampleoutput&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;예제 출력&amp;nbsp;&lt;button type=&quot;button&quot; class=&quot;btn btn-link copy-button no-print&quot; data-clipboard-target=&quot;#sample-output-1&quot; style=&quot;border-radius: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 14px; line-height: 1.42857; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Noto Sans CJK KR&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, 나눔바른고딕, 나눔고딕, NanumGothic, 맑은고딕, &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, sans-serif; color: rgb(66, 139, 202); overflow: visible; cursor: pointer; text-align: center; white-space: nowrap; vertical-align: middle; user-select: none; background-image: none; border-width: 1px; border-style: solid; border-color: transparent; box-shadow: none; outline: 0px !important;&quot;&gt;복사&lt;/button&gt;&lt;/h2&gt;&lt;/div&gt;&lt;pre class=&quot;sampledata&quot; id=&quot;sample-output-1&quot; style=&quot;box-sizing: border-box; border-radius: 5px; overflow-x: scroll; overflow-y: auto; font-family: Menlo, Monaco, &amp;quot;Source Code Pro&amp;quot;, consolas, monospace; font-size: 18px; padding: 8px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; word-break: normal; word-wrap: normal; background-color: rgb(247, 247, 249); border: 1px solid rgb(225, 225, 232);&quot;&gt;21&lt;/pre&gt;&lt;/section&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;section id=&quot;hint&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;headline&quot; style=&quot;box-sizing: border-box; margin: 10px 0px 25px; border-bottom: 1px dotted rgb(228, 233, 240); border-radius: 0px !important;&quot;&gt;&lt;h2 style=&quot;box-sizing: border-box; font-weight: normal; line-height: 33px; color: rgb(88, 95, 105); margin: 0px 0px -2px; font-size: 22px; text-shadow: none; padding-bottom: 5px; display: inline-block; border-bottom: 2px solid rgb(0, 118, 192); border-radius: 0px !important;&quot;&gt;코드&lt;/h2&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;col-md-12&quot; style=&quot;box-sizing: border-box; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Noto Sans CJK KR&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, 나눔바른고딕, 나눔고딕, NanumGothic, 맑은고딕, &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, sans-serif; border-radius: 0px !important;&quot;&gt;&lt;section id=&quot;problem_tags&quot; style=&quot;box-sizing: border-box; border-radius: 0px !important;&quot;&gt;&lt;div class=&quot;colorscripter-code&quot; style=&quot;color:#f0f0f0; font-family:Monaco !important; position:relative !important; overflow:auto&quot;&gt;&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin:0; padding:0; border:none; background-color:#272727; border-radius:4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;padding:6px; border-right:2px solid #4f4f4f&quot;&gt;&lt;div style=&quot;margin:0; padding:0; word-break:normal; text-align:right; color:#aaa; font-family:Monaco !important; line-height:130%&quot;&gt;&lt;div style=&quot;line-height:130%&quot;&gt;1&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;2&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;3&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;4&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;5&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;6&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;7&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;8&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;9&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;10&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;11&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;12&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;13&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;14&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;15&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;16&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;17&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;18&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;19&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;20&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;21&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;22&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;23&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;24&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;25&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;26&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;27&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;28&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;29&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;30&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;31&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;32&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;33&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;34&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;35&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;36&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;37&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;38&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;39&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;40&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;41&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;42&lt;/div&gt;&lt;div style=&quot;line-height:130%&quot;&gt;43&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;padding:6px 0&quot;&gt;&lt;div style=&quot;margin:0; padding:0; color:#f0f0f0; font-family:Monaco !important; line-height:130%&quot;&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;package&lt;/span&gt;&amp;nbsp;dp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;import&lt;/span&gt;&amp;nbsp;java.util.&lt;span style=&quot;color:#4be6fa&quot;&gt;Scanner&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;/**&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;&amp;nbsp;*&amp;nbsp;https://www.acmicpc.net/problem/2225&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;&amp;nbsp;*&amp;nbsp;합분해&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;&amp;nbsp;*&amp;nbsp;@author&amp;nbsp;minjung&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;&amp;nbsp;*/&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;class&lt;/span&gt;&amp;nbsp;baekjoon_2225&amp;nbsp;{&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;static&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;void&lt;/span&gt;&amp;nbsp;main(&lt;span style=&quot;color:#4be6fa&quot;&gt;String&lt;/span&gt;[]&amp;nbsp;args)&amp;nbsp;{&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#999999&quot;&gt;//&amp;nbsp;TODO&amp;nbsp;Auto-generated&amp;nbsp;method&amp;nbsp;stub&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;Scanner&lt;/span&gt;&amp;nbsp;sc&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;Scanner&lt;/span&gt;(&lt;span style=&quot;color:#4be6fa&quot;&gt;System&lt;/span&gt;.&lt;span style=&quot;color:#4be6fa&quot;&gt;in&lt;/span&gt;);&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;N&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;sc.nextInt();&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;K&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;sc.nextInt();&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;[][]&amp;nbsp;dp&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;[N&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;][K&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;];&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#999999&quot;&gt;//&amp;nbsp;초기화&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;for&lt;/span&gt;&amp;nbsp;(&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;;&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;K;&amp;nbsp;i&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&amp;nbsp;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dp[&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;][i]&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;i;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;for&lt;/span&gt;&amp;nbsp;(&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;2&lt;/span&gt;;&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;N;&amp;nbsp;i&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&amp;nbsp;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;for&lt;/span&gt;&amp;nbsp;(&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;j&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;;&amp;nbsp;j&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;K;&amp;nbsp;j&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&amp;nbsp;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;if&lt;/span&gt;&amp;nbsp;(&amp;nbsp;j&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;&amp;nbsp;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dp[i][j]&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;else&lt;/span&gt;&amp;nbsp;{&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;for&lt;/span&gt;&amp;nbsp;(&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;int&lt;/span&gt;&amp;nbsp;k&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;0&lt;/span&gt;;&amp;nbsp;k&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;i;&amp;nbsp;k&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&amp;nbsp;){&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dp[i][j]&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;dp[i&lt;span style=&quot;color:#ff3399&quot;&gt;-&lt;/span&gt;k][j&lt;span style=&quot;color:#ff3399&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;];&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dp[i][j]&amp;nbsp;&lt;span style=&quot;color:#ff3399&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#ff3399&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#c10aff&quot;&gt;1&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#4be6fa&quot;&gt;System&lt;/span&gt;.&lt;span style=&quot;color:#4be6fa&quot;&gt;out&lt;/span&gt;.&lt;span style=&quot;color:#4be6fa&quot;&gt;println&lt;/span&gt;(dp[N][K]%&lt;span style=&quot;color:#c10aff&quot;&gt;1000000000&lt;/span&gt;);&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre; line-height:130%&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align:right; margin-top:-13px; margin-right:5px; font-size:9px; font-style:italic&quot;&gt;&lt;a href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; style=&quot;color: rgb(79, 79, 79);&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;vertical-align:bottom; padding:0 2px 4px 0&quot;&gt;&lt;a href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; style=&quot;color: white;&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: rgb(79, 79, 79); border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>Algorithm/Baekjoon Online Judge</category>
      <category>algorithm</category>
      <category>Baekjoon Online Judege</category>
      <category>boj</category>
      <category>DP</category>
      <category>java</category>
      <author>best</author>
      <guid isPermaLink="true">https://best421.tistory.com/117</guid>
      <comments>https://best421.tistory.com/117#entry117comment</comments>
      <pubDate>Wed, 19 Apr 2017 16:27:37 +0900</pubDate>
    </item>
  </channel>
</rss>