<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title>최익필의 이름없는 블로그</title>
		<link>http://ikpil.com/</link>
		<description>공부할 때 정리 장소로 쓰거나 웹서핑할때 메모 할 때 쓰거나, 개인적인 생각을 기록하기 위해서 사용 되는 블로그 입니다.</description>
		<language>ko</language>
		<pubDate>Mon, 29 Aug 2011 23:17:29 +0900</pubDate>
		<generator>Tistory 1.1 (http://www.tistory.com/)</generator>
		<item>
			<title>문제 43, 셈, Counting, PC/UVa ID : 110603/10198, 인기도 : B, 성공률 : 높음, 레벨 : 2</title>
			<link>http://ikpil.com/1322</link>
			<description>&lt;p style=&quot;text-align: center;&quot;&gt;문제 43, 셈, Counting, PC/UVa ID : 110603/10198, 인기도 : B, 성공률 : 높음, 레벨 : 2&lt;br /&gt;
&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;a title=&quot;[http://wiki.ikpil.com/programming/programming_challenges/counting]로 이동합니다.&quot; target=&quot;_blank&quot; href=&quot;http://wiki.ikpil.com/programming/programming_challenges/counting&quot;&gt;http://wiki.ikpil.com/programming/programming_challenges/counting&lt;/a&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;:wq&lt;br /&gt;
&lt;/p&gt;&lt;div class=&quot;entry-ccl&quot; style=&quot;clear: both; text-align: right; margin-bottom: 10px&quot;&gt;
	&lt;img id=&quot;ccl-icon-1322-0&quot; class=&quot;entry-ccl-by&quot; src=&quot;http://i1.daumcdn.net/cfs.tistory/v/0/static/admin/editor/ccl_black01.png&quot; alt=&quot;저작자 표시&quot;/&gt;
	&lt;!--
	&lt;rdf:RDF xmlns=&quot;http://web.resource.org/cc/&quot; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot;&gt;
		&lt;Work rdf:about=&quot;&quot;&gt;
			&lt;license rdf:resource=&quot;http://creativecommons.org/licenses/by-fr/2.0/kr/&quot; /&gt;
		&lt;/Work&gt;
		&lt;License rdf:about=&quot;http://creativecommons.org/licenses/by-fr/&quot;&gt;
			&lt;permits rdf:resource=&quot;http://web.resource.org/cc/Reproduction&quot;/&gt;
			&lt;permits rdf:resource=&quot;http://web.resource.org/cc/Distribution&quot;/&gt;
			&lt;requires rdf:resource=&quot;http://web.resource.org/cc/Notice&quot;/&gt;
			&lt;requires rdf:resource=&quot;http://web.resource.org/cc/Attribution&quot;/&gt;
			&lt;permits rdf:resource=&quot;http://web.resource.org/cc/DerivativeWorks&quot;/&gt;
		&lt;/License&gt;
	&lt;/rdf:RDF&gt;
	--&gt;
&lt;/div&gt;
</description>
			<category>Programming Challenges : 알고리즘 트래이닝 북</category>
			<category>uva 10198</category>
			<category>점화식</category>
			<category>조합론</category>
			<author>농사를 짓는 게임 프로그래머 최익필</author>
			<guid>http://ikpil.com/1322</guid>
			<comments>http://ikpil.com/1322#entry1322comment</comments>
			<pubDate>Mon, 22 Aug 2011 01:50:51 +0900</pubDate>
		</item>
		<item>
			<title>문제 42, 땅 나누기, How many Pieces of Land?, PC/UVa ID : 110602/10213, 인기도 : B, 성공률 : 보통, 레벨 : 2</title>
			<link>http://ikpil.com/1321</link>
			<description>&lt;p style=&quot;text-align: center;&quot;&gt;문제 42, 땅 나누기, How many Pieces of Land?, PC/UVa ID : 110602/10213, 인기도 : B, 성공률 : 보통, 레벨 : 2&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;이 포스트를 만든 목적&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;생각 절차, 푼 방법, 고민거리 등을 기록하기 위해서 만들었다.&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;이 포스트의 준비물&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;Mozila Firefox 6.0&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;eclipse 3.6.1 + vrapper&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;java&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;참조 문헌&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;스티븐 스키에나, 미구엘 레비야 저. Programming Challenges: 알고리즘 트레이닝 북. 서환수 역.&lt;br /&gt;
Springer. 한빛미디어 초판 2쇄 2004.12.05. (문제 42, 땅 나누기, How many Pieces of Land?, p.173)&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;참조 링크&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;&lt;a title=&quot;[http://acm.uva.es/p/v102/10213.html]로 이동합니다.&quot; target=&quot;_blank&quot; href=&quot;http://acm.uva.es/p/v102/10213.html&quot;&gt;http://acm.uva.es/p/v102/10213.html&lt;/a&gt; : 문제 원문
&lt;/li&gt;
&lt;li&gt;&lt;a title=&quot;[http://www.algorithmist.com/index.php/UVa_10213]로 이동합니다.&quot; target=&quot;_blank&quot; href=&quot;http://www.algorithmist.com/index.php/UVa_10213&quot;&gt;http://www.algorithmist.com/index.php/UVa_10213&lt;/a&gt; : 문제 해설&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;간략한 이야기/프로그램의 입출력&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;타원 모양의 땅이 주어졌고, 그 땅 테두리에 n개의 점이 지정한 뒤, 각 n개의 점을 서로 이었을 때, &lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;최대&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; 몇조각으로 땅이 분리 되는가? n개의 점이 주어였을 때, 선분의 갯수는 n(n-1)/2 개 이다. 다음은 n=6 일때, 땅이 나뉜 모습이다.&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;a href=&quot;http://cfile29.uf.tistory.com/original/1772F7534E356D3F1A03CC&quot; rel=&quot;lightbox&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://cfile29.uf.tistory.com/image/1772F7534E356D3F1A03CC&quot; alt=&quot;&quot; filemime=&quot;image/jpeg&quot; filename=&quot;p10213.jpg&quot; height=&quot;300&quot; width=&quot;600&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;입력&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;첫번째 라인에는 테스트 캐스으의 갯수가 입력되며, 0 &amp;lt; s &amp;lt; 3511 작은 정수 s가 입력된다.&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;다음줄 부터는 0 &amp;lt;= n &amp;lt; 2^31 미만의 수가 입력되며, n 은 점의 갯수이다.&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;출력&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;한줄에 하나의 결과만 출력한다.&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;맛보기 사진&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;a href=&quot;http://cfile23.uf.tistory.com/original/1843BB544E356DF501A4D5&quot; rel=&quot;lightbox&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://cfile23.uf.tistory.com/image/1843BB544E356DF501A4D5&quot; alt=&quot;&quot; filemime=&quot;&quot; filename=&quot;cfile23.uf@1843BB544E356DF501A4D5.png&quot; height=&quot;302&quot; width=&quot;500&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;맛보기 코드&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;textarea class=&quot;brush:java&quot; title=&quot;How Many Pieces Of Land?&quot;&gt;package Problem042HowManyPiecesOfLand;

import java.util.*;
import java.math.BigInteger;

public class HowManyPiecesOfLand
{
    public static void main(String args[])
    {
        Scanner sc = new Scanner(System.in);
       
        int testCase = sc.nextInt();
        for (int i = 0; i &amp;lt; testCase; ++i)
        {
            long n = sc.nextLong();
            BigInteger piesceCount = PieceCalculation.calculate(n);
            System.out.println(piesceCount);
        }
    }
}

class PieceCalculation
{
    public static BigInteger calculate(long n)
    {
        if (1 &amp;gt;= n)
            return BigInteger.ONE;
       
        // 최초 1개의 땅 + 선분의 갯수로 늘어난 땅
        BigInteger pieces = BigInteger.ONE.add(BigInteger.valueOf(n * (n - 1) / 2));
       
        // 각 선분끼리 충돌하며 늘어난 땅
        for (long p = 1; p &amp;lt; n; ++p)
        {
            for (long pp = p + 2; pp &amp;lt; n; ++pp)
            {
                // 충돌 가능한 선의 갯수를 조사한다.
                long point = pp - p - 1;
                pieces = pieces.add(BigInteger.valueOf(point * p));
            }
        }
       
        return pieces;
    }
}
&lt;/textarea&gt;
&lt;br /&gt;
&lt;textarea class=&quot;brush:java&quot; title=&quot;JUnit&quot;&gt;package Problem042HowManyPiecesOfLand;

import static org.junit.Assert.*;

import org.junit.Test;
import java.math.BigInteger;

public class HowManyPiecesOfLandTest
{
    BigInteger answer1 = new BigInteger(&quot;1&quot;);
    BigInteger answer2 = new BigInteger(&quot;2&quot;);
    BigInteger answer3 = new BigInteger(&quot;4&quot;);
    BigInteger answer4 = new BigInteger(&quot;8&quot;);
    BigInteger answer5 = new BigInteger(&quot;16&quot;);
    BigInteger answer6 = new BigInteger(&quot;31&quot;);
    BigInteger answer7 = new BigInteger(&quot;57&quot;);
   
    BigInteger answer8 = new BigInteger(&quot;99&quot;);
    BigInteger answer9 = new BigInteger(&quot;163&quot;);
    BigInteger answer10 = new BigInteger(&quot;256&quot;);
   
    BigInteger answer2_31_1 = new BigInteger(&quot;886151993063477126682488902248300547&quot;);
   
    @Test
    public void testCalculate1()
    {
        assertTrue(answer1.equals(PieceCalculation.calculate(1)));
        assertTrue(answer2.equals(PieceCalculation.calculate(2)));
        assertTrue(answer3.equals(PieceCalculation.calculate(3)));
        assertTrue(answer4.equals(PieceCalculation.calculate(4)));
        assertTrue(answer5.equals(PieceCalculation.calculate(5)));
        assertTrue(answer6.equals(PieceCalculation.calculate(6)));
        assertTrue(answer7.equals(PieceCalculation.calculate(7)));
       
        assertTrue(answer8.equals(PieceCalculation.calculate(8)));
        assertTrue(answer9.equals(PieceCalculation.calculate(9)));
        assertTrue(answer10.equals(PieceCalculation.calculate(10)));
    }
   
    @Test
    public void testCalculate2()
    {
        // 이 테스트 케이스는 3분을 초과한다. 속도 계선을 위해 알고리즘 변경이
        // 필요하다.
        assertTrue(answer2_31_1.equals(
                PieceCalculation.calculate((long)Math.pow(2, 32) - 1)));
       
    }
}
&lt;/textarea&gt;&lt;br /&gt;
&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;
&lt;span style=&quot;font-size: 18pt;&quot;&gt;여담&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;선이 서로 출돌될 때, 조각 하나가 생기므로, 충돌 선의 갯수를 조사한 공식으로 만들었다.&lt;br /&gt;
&lt;/li&gt;&lt;li&gt;충돌 공식을 만들기 위해 원을 30개쯤 그렸다.&lt;br /&gt;
&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;충돌 공식은 각 점에 인덱스 0 ~ n - 1 를 부여하고, 0 ~ n - 1 개의 점을 일일이 선을 그으면서, 충돌될 선을 샌 것이다.&lt;br /&gt;
&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;충돌 갯수를 for 문으로 조사하기 때문에, 2^31 - 1 개의 점이 있을 때, 무척 느린 성능을 나타낸다.(결국 속도 개선을 위한 알고리즘 변경이 필요함)&lt;br /&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;:wq!&lt;br /&gt;
&lt;/p&gt;&lt;div class=&quot;entry-ccl&quot; style=&quot;clear: both; text-align: right; margin-bottom: 10px&quot;&gt;
	&lt;img id=&quot;ccl-icon-1321-0&quot; class=&quot;entry-ccl-by&quot; src=&quot;http://i1.daumcdn.net/cfs.tistory/v/0/static/admin/editor/ccl_black01.png&quot; alt=&quot;저작자 표시&quot;/&gt;
	&lt;!--
	&lt;rdf:RDF xmlns=&quot;http://web.resource.org/cc/&quot; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot;&gt;
		&lt;Work rdf:about=&quot;&quot;&gt;
			&lt;license rdf:resource=&quot;http://creativecommons.org/licenses/by-fr/2.0/kr/&quot; /&gt;
		&lt;/Work&gt;
		&lt;License rdf:about=&quot;http://creativecommons.org/licenses/by-fr/&quot;&gt;
			&lt;permits rdf:resource=&quot;http://web.resource.org/cc/Reproduction&quot;/&gt;
			&lt;permits rdf:resource=&quot;http://web.resource.org/cc/Distribution&quot;/&gt;
			&lt;requires rdf:resource=&quot;http://web.resource.org/cc/Notice&quot;/&gt;
			&lt;requires rdf:resource=&quot;http://web.resource.org/cc/Attribution&quot;/&gt;
			&lt;permits rdf:resource=&quot;http://web.resource.org/cc/DerivativeWorks&quot;/&gt;
		&lt;/License&gt;
	&lt;/rdf:RDF&gt;
	--&gt;
&lt;/div&gt;
</description>
			<category>Programming Challenges : 알고리즘 트래이닝 북</category>
			<category>How Many Pieces of Land</category>
			<category>uva 10213</category>
			<category>땅 나누기</category>
			<author>농사를 짓는 게임 프로그래머 최익필</author>
			<guid>http://ikpil.com/1321</guid>
			<comments>http://ikpil.com/1321#entry1321comment</comments>
			<pubDate>Mon, 01 Aug 2011 00:09:50 +0900</pubDate>
		</item>
		<item>
			<title>문제 41, 피보나치 수의 개수, How many Fibs?, PC/UVa ID : 110601/10183, 인기도 : B, 성공률 : 보통, 레벨 : 1</title>
			<link>http://ikpil.com/1320</link>
			<description>&lt;p style=&quot;text-align: center;&quot;&gt;문제 41, 피보나치 수의 개수, How many Fibs?, PC/UVa ID : 110601/10183, 인기도 : B, 성공률 : 보통, 레벨 : 1&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;이 포스트를 만든 목적&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;생각 절차, 푼 방법, 고민거리 등을 기록하기 위해서 만들었다.&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;이 포스트의 준비물&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;Mozila Firefox 6.0&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;eclipse 3.6.1 + vrapper&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;java&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;참조 문헌&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;스티븐 스키에나, 미구엘 레비야 저. Programming Challenges: 알고리즘 트레이닝 북. 서환수 역.&lt;br /&gt;
Springer. 한빛미디어 초판 2쇄 2004.12.05. (문제 41, 피보나치 수의 개수, How many Fibs?, p.172)&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;참조 링크&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;&lt;a title=&quot;[http://uva.onlinejudge.org/index.php?option=onlinejudge&amp;amp;page=show_problem&amp;amp;problem=1124]로 이동합니다.&quot; target=&quot;_blank&quot; href=&quot;http://uva.onlinejudge.org/index.php?option=onlinejudge&amp;amp;page=show_problem&amp;amp;problem=1124&quot;&gt;http://uva.onlinejudge.org/index.php?option=onlinejudge&amp;amp;page=show_problem&amp;amp;problem=1124&lt;/a&gt; : 문제 원문&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a title=&quot;[http://www.algorithmist.com/index.php/UVa_10183]로 이동합니다.&quot; target=&quot;_blank&quot; href=&quot;http://www.algorithmist.com/index.php/UVa_10183&quot;&gt;http://www.algorithmist.com/index.php/UVa_10183&lt;/a&gt; : 문제 원문&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a title=&quot;[http://belbesy.wordpress.com/2011/05/31/uva-10183-how-many-fibs/]로 이동합니다.&quot; target=&quot;_blank&quot; href=&quot;http://belbesy.wordpress.com/2011/05/31/uva-10183-how-many-fibs/&quot;&gt;http://belbesy.wordpress.com/2011/05/31/uva-10183-how-many-fibs/&lt;/a&gt; : 문제 풀이&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a title=&quot;[http://cherrykyun.tistory.com/219]로 이동합니다.&quot; target=&quot;_blank&quot; href=&quot;http://cherrykyun.tistory.com/219&quot;&gt;http://cherrykyun.tistory.com/219&lt;/a&gt; : 문제 풀이&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;간략한 이야기/프로그램의 입출력&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;피보나치 수는 다음 처럼 정의 된다.&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;&lt;i&gt;f&lt;/i&gt;&lt;sub&gt;1&lt;/sub&gt; := 1 &lt;br /&gt;
&lt;i&gt;f&lt;/i&gt;&lt;sub&gt;2&lt;/sub&gt; := 2 
  &lt;br /&gt;
&lt;i&gt;f&lt;/i&gt;&lt;sub&gt;n&lt;/sub&gt; := &lt;i&gt;f&lt;/i&gt;&lt;sub&gt;n-1&lt;/sub&gt; + &lt;i&gt;f&lt;/i&gt;&lt;sub&gt;n-2&lt;/sub&gt; 
  &amp;nbsp; &amp;nbsp; (n&amp;gt;=3) &lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;두개의 수 a 와 b 가 주어졌을 때, 이 두 수 사이에 얼마나 많은 피보나치 수가 있는지 계산해라.&lt;br /&gt;
&lt;/p&gt;

&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;입력&lt;/span&gt;&lt;/span&gt;&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;여러개의 테스트 케이스가 입력될 수 있다.&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;각 테스트 케이스는 두개의 수 a, b를 입력 받는다.&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;a 와 b가 0일 경우, 프로그램은 종료된다.&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;a와 b의 범위는 &lt;i&gt;a&amp;lt;=b&amp;lt;=10&lt;sup&gt;100&lt;/sup&gt;&lt;/i&gt; 이며, a, b는 양의 정수이다.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;출력&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;각 테스트 케이스는 한 라인에 &lt;i&gt;a&amp;lt;=f&lt;sub&gt;i&lt;/sub&gt;&amp;lt;=b&lt;/i&gt;. 의 피보노치 수의 개수를 출력 한다.&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;맛보기 코드&lt;/span&gt;&lt;/span&gt;&lt;p&gt;
&lt;textarea class=&quot;brush:java&quot; title=&quot;How many Fbis&quot;&gt;package Problem041HowManyFibs;

import java.util.*;
import java.math.BigInteger;

public class HowManyFibs
{
    public static void main(String args[])
    {
        Scanner sc = new Scanner(System.in);
       
        for (;;)
        {
            BigInteger a = sc.nextBigInteger();
            BigInteger b = sc.nextBigInteger();
           
            if (BigInteger.ZERO.equals(a) &amp;amp;&amp;amp; BigInteger.ZERO.equals(b))
                break;
           
            int answer = HowManyFibsReal.calculate(a, b);
            System.out.println(answer);
        }
    }
}


class HowManyFibsReal
{
    public static int calculate(BigInteger a, BigInteger b)
    {
        BigInteger n[] = new BigInteger[3];
        n[0] = BigInteger.ZERO;
        n[1] = BigInteger.ONE;
   
        int number = 0;
        for (;;)
        {
            n[2] = n[0].add(n[1]);
            n[0] = n[1];
            n[1] = n[2];
           
            if (0 &amp;lt; a.compareTo(n[2]))
                continue;
           
            if (0 &amp;gt; b.compareTo(n[2]))
                return number;
            else
                ++number;
        }
    }
}
&lt;/textarea&gt;
&lt;br /&gt;
&lt;textarea class=&quot;brush:java&quot; title=&quot;junit&quot;&gt;package Problem041HowManyFibs;

import static org.junit.Assert.*;

import java.math.BigInteger;

import org.junit.Test;

public class HowManyFibsTest {

    @Test
    public void testCalculateFibsNumber1()
    {
        assertTrue(5 == HowManyFibsReal.calculate(
                new BigInteger(&quot;10&quot;), new BigInteger(&quot;100&quot;)));
    }

    @Test
    public void testCalculateFibsNumber2()
    {
        assertTrue(4 == HowManyFibsReal.calculate(
                new BigInteger(&quot;1234567890&quot;), new BigInteger(&quot;9876543210&quot;)));
    }
}
&lt;/textarea&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold; font-size: 18pt;&quot;&gt;&lt;span&gt;맛보기 사진&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;a href=&quot;http://cfile7.uf.tistory.com/original/127BFC404E3192A22FD136&quot; rel=&quot;lightbox&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://cfile7.uf.tistory.com/image/127BFC404E3192A22FD136&quot; alt=&quot;&quot; filemime=&quot;&quot; filename=&quot;cfile7.uf@127BFC404E3192A22FD136.png&quot; height=&quot;303&quot; width=&quot;500&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;여담&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;최대 100 자리수까지 고려해야 하므로, C 에선 문자열로 처리해 주어야 한다.&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;JAVA 에선 BigInteger 클래스를 이용하면, 100 자리수도 계산할 수 있다.&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;피보노치 수를 테이블 표로 만들고, 이 표의 범위로 개수를 찾는 방법으로 푼 것을 보았다.(재미있었다.)&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;어려운건 없었다.&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;:wq!&lt;br /&gt;
&lt;/p&gt;&lt;div class=&quot;entry-ccl&quot; style=&quot;clear: both; text-align: right; margin-bottom: 10px&quot;&gt;
	&lt;img id=&quot;ccl-icon-1320-0&quot; class=&quot;entry-ccl-by&quot; src=&quot;http://i1.daumcdn.net/cfs.tistory/v/0/static/admin/editor/ccl_black01.png&quot; alt=&quot;저작자 표시&quot;/&gt;
	&lt;!--
	&lt;rdf:RDF xmlns=&quot;http://web.resource.org/cc/&quot; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot;&gt;
		&lt;Work rdf:about=&quot;&quot;&gt;
			&lt;license rdf:resource=&quot;http://creativecommons.org/licenses/by-fr/2.0/kr/&quot; /&gt;
		&lt;/Work&gt;
		&lt;License rdf:about=&quot;http://creativecommons.org/licenses/by-fr/&quot;&gt;
			&lt;permits rdf:resource=&quot;http://web.resource.org/cc/Reproduction&quot;/&gt;
			&lt;permits rdf:resource=&quot;http://web.resource.org/cc/Distribution&quot;/&gt;
			&lt;requires rdf:resource=&quot;http://web.resource.org/cc/Notice&quot;/&gt;
			&lt;requires rdf:resource=&quot;http://web.resource.org/cc/Attribution&quot;/&gt;
			&lt;permits rdf:resource=&quot;http://web.resource.org/cc/DerivativeWorks&quot;/&gt;
		&lt;/License&gt;
	&lt;/rdf:RDF&gt;
	--&gt;
&lt;/div&gt;
</description>
			<category>Programming Challenges : 알고리즘 트래이닝 북</category>
			<category>How many fibs?</category>
			<category>IT</category>
			<category>uva 10183</category>
			<category>피보나치 수의 개수</category>
			<author>농사를 짓는 게임 프로그래머 최익필</author>
			<guid>http://ikpil.com/1320</guid>
			<comments>http://ikpil.com/1320#entry1320comment</comments>
			<pubDate>Fri, 29 Jul 2011 01:53:29 +0900</pubDate>
		</item>
		<item>
			<title>문제 40, 모든 쌍의 합, Pairsumonious Numbers, PC/UVa ID : 110508/10202, 인기도 : B, 성공률 : 높음, 레벨 : 4</title>
			<link>http://ikpil.com/1319</link>
			<description>&lt;p style=&quot;text-align: center;&quot;&gt;문제 40, 모든 쌍의 합, Pairsumonious Numbers, PC/UVa ID : 110508/10202, 인기도 : B, 성공률 : 높음, 레벨 : 4&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;이 포스트를 만든 목적&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;생각 절차, 푼 방법, 고민거리 등을 기록하기 위해서 만들었다.&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;이 포스트의 준비물&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;Mozila Firefox 5.0&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;eclipse 3.6.1 + vrapper&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;java&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;참조 문헌&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;스티븐 스키에나, 미구엘 레비야 저. Programming Challenges: 알고리즘 트레이닝 북. 서환수 역.&lt;br /&gt;
Springer. 한빛미디어 초판 2쇄 2004.12.05. (문제 40, 모든 쌍의 합, Pairsumonious Numbers, p.161)&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;참조 링크&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;a title=&quot;[http://plg1.cs.uwaterloo.ca/~acm00/010929/B.htm]로 이동합니다.&quot; target=&quot;_blank&quot; href=&quot;http://plg1.cs.uwaterloo.ca/%7Eacm00/010929/B.htm&quot;&gt;http://plg1.cs.uwaterloo.ca/~acm00/010929/B.htm&lt;/a&gt; -- 문제 원문&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a title=&quot;[http://uva.onlinejudge.org/index.php?option=onlinejudge&amp;amp;page=show_problem&amp;amp;problem=1143]로 이동합니다.&quot; target=&quot;_blank&quot; href=&quot;http://uva.onlinejudge.org/index.php?option=onlinejudge&amp;amp;page=show_problem&amp;amp;problem=1143&quot;&gt;http://uva.onlinejudge.org/index.php?option=onlinejudge&amp;amp;page=show_problem&amp;amp;problem=1143&lt;/a&gt; -- 문제 원문&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;간략한 이야기/프로그램의 입출력&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;10 &amp;gt; n &amp;gt; 2 의 n이 주어졌을 때, n개의 정수들의 모든 쌍의 합의 갯수는 n(n-1)/2 이다. 이런 쌍의 합들이 n(n-1)/2 개 주어졌을 때, 합을 만들 수 있는 n개의 정수를 찾아라.&lt;br /&gt;
&lt;/p&gt;

&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;입력&lt;/span&gt;&lt;/span&gt;&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;각 입력 라인은 스페이스로 구분된 n과 n(n-1)/2 개의 정수 두개를 받는다.&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;출력&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;합을 만들 수 있는 n 개의 정수를 오림차 순으로 각 입력 라인당 한 라인에 출력하라.&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;만약 한개 보다 더 많이 답이 있을 경우, 답 중 아무거나 출력하라.&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;답이 없을 경우, &quot;impossible&quot;을 출력하라.&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;맛보기 코드&lt;/span&gt;&lt;/span&gt;&lt;p&gt;
&lt;textarea class=&quot;brush:java&quot; title=&quot;Pairsumonious Numbers&quot;&gt;package Problem040PairsumoniousNumbers;

import java.util.*;

public class PairsumoniousNumbers
{
    static public void main(String args[])
    {
        Scanner sc = new Scanner(System.in);
        do
        {
            int n = sc.nextInt();
            int pairSumonious[] = new int[n * (n-1) / 2];
            for (int i = 0; i &amp;lt; pairSumonious.length; ++i)
                pairSumonious[i] = sc.nextInt();
           
            PairsumoniousNumbersReal p = new PairsumoniousNumbersReal(n, pairSumonious);
            int[] numbers = p.findNumbers();
            if (null == numbers)
                System.out.println(&quot;Impossible&quot;);
            else
            {
                for (int i = 0; i &amp;lt; n; ++i)
                    System.out.print(numbers[i] + &quot; &quot;);
               
                System.out.println();
            }
        } while(true);
    }   
}

class PairsumoniousNumbersReal
{   
    int n = 0;
    int expression[][] = null;
    int pairSumonious[] = null;
    int arrayNumbers[] = null;
    int abcd = 0;
   
   
    public PairsumoniousNumbersReal(int n, int ... pairSumonious)
    {
        this.n = n;
       
        this.pairSumonious = pairSumonious;
        this.arrayNumbers = new int[n];
       
        // 가우스 소거법을 사용하기 위한 식을 만든다.(행렬쯤 된다)
        expression = new int[pairSumonious.length][n];
        int expressionCount = 0;
        for (int i = 0; i &amp;lt; n; ++i)
        {
            for (int ii = i; ii &amp;lt; n - 1; ++ii)
            {
                expression[expressionCount][i] = 1;
                expression[expressionCount][ii + 1] = 1;
                ++expressionCount;
            }
        }
    }
   
    public int[] findNumbers()
    {
        // 모든 정수의 합을 구한다. 즉, a + b + c + d = abcd 로 표현한다.
        for (int i = 0; i &amp;lt; pairSumonious.length; ++i)
            abcd += pairSumonious[i];
       
        if (0 != (abcd % (n-1)))
            return null;       

        abcd /= (n - 1);
       
        // 올림차 정렬
        Arrays.sort(pairSumonious);
       
        // n 이 3일 경우, 백트래킹 돌 필요가 없으므로, 그냥 계산한다.
        if (3 == n)
        {
            return findNumbersReal();
        }
        else
        {
            // 백트래킹을 하되 최하값 두개와 최고값 두개는 이미 결정되었으므로
            // 4개의 백트래킹을 하지 않는다.
            int back[] = new int[pairSumonious.length - 4];
            Arrays.fill(back, -1);
            return backTracking(back, 0);
        }
    }
   
    public int[] findNumbersReal()
    {
        for (int i = 0; i &amp;lt; n; ++i)
        {
            // 값을 구하고
            int processSum = -abcd;
            for (int ii = 0; ii &amp;lt; pairSumonious.length; ++ii)
            {
                if (1 == expression[ii][i])
                    processSum += pairSumonious[ii];
            }
           
            arrayNumbers[i] = processSum / (n - 2);
           
            // 검산 한다.
            if (i &amp;gt; 0)
            {
                if (pairSumonious[i - 1] != arrayNumbers[0] + arrayNumbers[i])
                    return null;
            }
        }
       
        //DebugPrint.printArray(&quot;답 찾은 후&quot;, arrayNumbers);
        return arrayNumbers;
    }
   
    int[] backTracking(int[] back, int deep)
    {
        if (deep &amp;gt;= back.length)
        {
            // 백트래킹 결과를 보정한다
            int temp[] = new int[back.length];
           
            for (int i = 0; i &amp;lt; back.length; ++i)
                temp[i] = pairSumonious[back[i] + 2];
           
            for (int i = 0; i &amp;lt; temp.length; ++i)
                pairSumonious[i + 2] = temp[i];
            //DebugPrint.printArray(&quot;정렬 &quot;, pairSumonious);
            return findNumbersReal();
        }
       
        // 백 트래킹
        for (int i = 0; i &amp;lt; back.length; ++i)
        {
            if (true == isContainValue(back, i))
                continue;
           
            back[deep] = i;
            int[] numbers =  backTracking(back, deep + 1);
            if (null != numbers)
                return numbers;
           
            back[deep] = -1;
        }
       
        return null;
    }
   
    // 배열에 특정 값이 있는지 확인
    public static boolean isContainValue(int[] array, int value)
    {
        for (int i = 0; i &amp;lt; array.length; ++i)
        {
            if (value == array[i])
                return true;
        }
       
        return false;
    }
}

class DebugPrint
{
    static void printArray(String content, int[] arrayTarget)
    {       
        System.out.println(content + Arrays.toString(arrayTarget));
    }
    static void printArray(String content, int[][] arrayTarget)
    {
        for (int i = 0; i &amp;lt; arrayTarget.length; ++i)
        {
            printArray(content, arrayTarget[i]);
        }
    }
    static void print(String content, int answer)
    {
        System.out.println(content + answer);
    }
}
&lt;/textarea&gt;&lt;br /&gt;
&lt;textarea class=&quot;brush:java&quot; title=&quot;unit test&quot;&gt;package Problem040PairsumoniousNumbers;

import static org.junit.Assert.assertTrue;

import java.util.Arrays;

import org.junit.Test;

public class PairsumoniousNumbersTest {

    @Test
    public void testFindNumbers1()
    {
        PairsumoniousNumbersReal test = new PairsumoniousNumbersReal(3, 1269, 1160, 1663);
       
        assertTrue(Arrays.equals(new int[] { 383, 777, 886 }, test.findNumbers()));
    }

    @Test
    public void testFindNumbers2()
    {
        PairsumoniousNumbersReal test = new PairsumoniousNumbersReal(3, 1, 1, 1);
       
        assertTrue(Arrays.equals(null, test.findNumbers()));
    }
   
    @Test
    public void testFindNumbers3()
    {
        PairsumoniousNumbersReal test = new PairsumoniousNumbersReal(5,
                226, 223, 225, 224, 227, 229, 228, 226, 225, 227);
       
        assertTrue(Arrays.equals(new int[] { 111, 112, 113, 114, 115 },
                test.findNumbers()));
    }
   
    @Test
    public void testFindNumbers4()
    {
        PairsumoniousNumbersReal test = new PairsumoniousNumbersReal(5,
                216, 210, 204, 212, 220, 214, 222, 208, 216, 210);
       
        assertTrue(Arrays.equals(new int[] { 101, 103, 107, 109, 113 },
                test.findNumbers()));
    }
   
    @Test
    public void testFindNumbers5()
    {
        PairsumoniousNumbersReal test = new PairsumoniousNumbersReal(5,
                -1, 0, -1, -2, 1, 0, -1, 1, 0, -1);
       
        assertTrue(Arrays.equals(new int[] { -1, -1, 0, 0, 1 },
                test.findNumbers()));
    }
   
    @Test
    public void testFindNumbers6()
    {
        PairsumoniousNumbersReal test = new PairsumoniousNumbersReal(5,
                79950, 79936, 79942, 79962, 79954, 79972, 79960, 79968, 79924, 79932);
       
        assertTrue(Arrays.equals(
                new int[] { 39953, 39971, 39979, 39983, 39989 },
                test.findNumbers()));
    }
}
&lt;/textarea&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;맛보기 사진&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;a href=&quot;http://cfile7.uf.tistory.com/original/136F47494E2EDA341C0640&quot; rel=&quot;lightbox&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://cfile7.uf.tistory.com/image/136F47494E2EDA341C0640&quot; alt=&quot;&quot; filemime=&quot;&quot; filename=&quot;cfile7.uf@136F47494E2EDA341C0640.png&quot; height=&quot;303&quot; width=&quot;500&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;여담&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;좀 더 쉬운 방법이 있을거 같다는 생각이 든다. &lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;가우스 소거법에서 아이디어를 얻어 풀었는데, 이게 보다 쉽게 푸는것을 방해한 것일 수 있다.&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;백트래킹을 좀 더 최적화 할 수 있을것 같으나, 능력이 부족하다.&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;:wq!&lt;br /&gt;
&lt;/p&gt;&lt;div class=&quot;entry-ccl&quot; style=&quot;clear: both; text-align: right; margin-bottom: 10px&quot;&gt;
	&lt;img id=&quot;ccl-icon-1319-0&quot; class=&quot;entry-ccl-by&quot; src=&quot;http://i1.daumcdn.net/cfs.tistory/v/0/static/admin/editor/ccl_black01.png&quot; alt=&quot;저작자 표시&quot;/&gt;
	&lt;!--
	&lt;rdf:RDF xmlns=&quot;http://web.resource.org/cc/&quot; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot;&gt;
		&lt;Work rdf:about=&quot;&quot;&gt;
			&lt;license rdf:resource=&quot;http://creativecommons.org/licenses/by-fr/2.0/kr/&quot; /&gt;
		&lt;/Work&gt;
		&lt;License rdf:about=&quot;http://creativecommons.org/licenses/by-fr/&quot;&gt;
			&lt;permits rdf:resource=&quot;http://web.resource.org/cc/Reproduction&quot;/&gt;
			&lt;permits rdf:resource=&quot;http://web.resource.org/cc/Distribution&quot;/&gt;
			&lt;requires rdf:resource=&quot;http://web.resource.org/cc/Notice&quot;/&gt;
			&lt;requires rdf:resource=&quot;http://web.resource.org/cc/Attribution&quot;/&gt;
			&lt;permits rdf:resource=&quot;http://web.resource.org/cc/DerivativeWorks&quot;/&gt;
		&lt;/License&gt;
	&lt;/rdf:RDF&gt;
	--&gt;
&lt;/div&gt;
</description>
			<category>Programming Challenges : 알고리즘 트래이닝 북</category>
			<category>IT</category>
			<category>pairsumonious numbers</category>
			<category>uva 10202</category>
			<category>가우스 소거법</category>
			<author>농사를 짓는 게임 프로그래머 최익필</author>
			<guid>http://ikpil.com/1319</guid>
			<comments>http://ikpil.com/1319#entry1319comment</comments>
			<pubDate>Wed, 27 Jul 2011 00:20:10 +0900</pubDate>
		</item>
		<item>
			<title>문제 39, 스턴-브로콧 수체계, The Stern-Brocot Number System, PC/UVa ID : 110507/10077, 인기도 : C, 성공률 : 높음, 레벨 : 1</title>
			<link>http://ikpil.com/1318</link>
			<description>&lt;p&gt;문제 39, 스턴-브로콧 수체계, The Stern-Brocot Number System, PC/UVa ID : 110507/10077, 인기도 : C, 성공률 : 높음, 레벨 : 1&lt;br /&gt;

&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;이 포스트를 만든 목적&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;생각 절차, 푼 방법, 고민거리 등을 기록하기 위해서 만들었다.&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;이 포스트의 준비물&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;Mozila Firefox 5.0&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;eclipse 3.6.1 + vrapper&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;java&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;참조 문헌&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;스티븐 스키에나, 미구엘 레비야 저. Programming Challenges: 알고리즘 트레이닝 북. 서환수 역.&lt;br /&gt;
Springer. 한빛미디어 초판 2쇄 2004.12.05. (문제 38, 스턴-브로콧 수체계, The Stern-Brocot Number System, p.159)&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;참조 링크&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;&lt;a title=&quot;[http://online-judge.uva.es/p/v100/10077.html]로 이동합니다.&quot; target=&quot;_blank&quot; href=&quot;http://online-judge.uva.es/p/v100/10077.html&quot;&gt; &lt;/a&gt;&lt;a title=&quot;[http://online-judge.uva.es/p/v100/10077.html]로 이동합니다.&quot; target=&quot;_blank&quot; href=&quot;http://online-judge.uva.es/p/v100/10077.html&quot;&gt;http://online-judge.uva.es/p/v100/10077.html&lt;/a&gt; - 문제 원문&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a title=&quot;[http://en.wikipedia.org/wiki/Stern%E2%80%93Brocot_tree]로 이동합니다.&quot; target=&quot;_blank&quot; href=&quot;http://en.wikipedia.org/wiki/Stern%E2%80%93Brocot_tree&quot;&gt;http://en.wikipedia.org/wiki/Stern-Brocot_tree&lt;/a&gt; - 영어 못하는데 검색하면 영어만 걸린다. ㅋ&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a title=&quot;[http://www.codecogs.com/latex/eqneditor.php]로 이동합니다.&quot; target=&quot;_blank&quot; href=&quot;http://www.codecogs.com/latex/eqneditor.php&quot;&gt;http://www.codecogs.com/latex/eqneditor.php&lt;/a&gt; - 수식을 이미지로 만들오 주는 싸이트&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a title=&quot;[http://online-judge.uva.es/board/viewtopic.php?f=9&amp;amp;t=6840]로 이동합니다.&quot; target=&quot;_blank&quot; href=&quot;http://online-judge.uva.es/board/viewtopic.php?f=9&amp;amp;t=6840&quot;&gt;http://online-judge.uva.es/board/viewtopic.php?f=9&amp;amp;t=6840&lt;/a&gt; - 잘 보면, 공통분모 개념 이용&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;간략한 이야기/프로그램의 입출력&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;스턴-브로콧 수체계를 이해하고, 양의 분수가 입력되었을 때, 그 분수가 스턴-브로콧 수체계에서 위치한 곳을 루트로 부터 L과 R로 표시하여 출력하라.루트는 다음 수를 기준으로 하고 루트의 1/1 로부터 외쪽으로 가면 L, 오른쪽으로 가면 R로 표기한다.&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;루트&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;a href=&quot;http://cfile8.uf.tistory.com/original/164BEC534E102E4E2EFBD8&quot; rel=&quot;lightbox&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://cfile8.uf.tistory.com/image/164BEC534E102E4E2EFBD8&quot; alt=&quot;&quot; filemime=&quot;image/gif&quot; filename=&quot;CodeCogsEqn.gif&quot; height=&quot;38&quot; width=&quot;50&quot;/&gt;&lt;/a&gt;&lt;/div&gt;이다.&lt;br /&gt;
&lt;/p&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;입력&lt;/span&gt;&lt;/span&gt;&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;

한줄에 양의 정수 m 과 n을 입력 받으며, m과 n은 서로 소다.&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;m과 n 모두 1이 입력되면 프로그램을 종료 시킨다.&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;m은 분자이고, n은 분모이다.&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;출력&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;루트를 기준으로 입력된 m/n의 위치를 L,R 로 출력한다.&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;맛보기 코드&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;textarea class=&quot;brush:java&quot; title=&quot;The Stern-Brocot Number System&quot;&gt;package Problem039TheSternBrocotNumberSystem;

import java.util.*;

public class TheSternBrocotNumberSystem 
{
	public static void main( String[] args)
	{
		Scanner sc = new Scanner(System.in);
		
		for (;;)
		{
			int m = sc.nextInt();
			int n = sc.nextInt();
			
			if ((1 &amp;gt;= m &amp;amp;&amp;amp; 1 &amp;gt;= n) || 1.0f == (double)m / (double)n)
				break;
			
			String strTree = getTreeString(m, n);
			
			System.out.println(strTree);
		}
	}
	
	public static String getTreeString(int m, int n)
	{
		StringBuffer sb = new StringBuffer();
		
		int[] arrNumerator = { 0, 1, 1 };
		int[] arrDenominator = { 1, 1, 0 };
		
		sb = moveTree(sb, arrNumerator, arrDenominator, m, n);
		
		return sb.toString();
	}
	
	private static StringBuffer moveTree(StringBuffer sb, int arrNumerator[], int arrDenominator[], int m, int n)
	{
		// 공통 분모를 만든다는 개념으로 보면, 이 주석는 좋지 않다.
		//double centerValue = (double)arrNumerator[1]/(double)arrDenominator[1];
		//double targetValue = (double)m / (double)n;
		int centerValue = arrNumerator[1] * n;
		int targetValue = arrDenominator[1] * m;
		
		if (centerValue == targetValue)
		{
			return sb;
		}
		else if (centerValue &amp;gt; targetValue)
		{
			sb.append(&quot;L&quot;);
			arrNumerator[2] = arrNumerator[1];
			arrDenominator[2] = arrDenominator[1];
		}
		else
		{
			sb.append(&quot;R&quot;);
			arrNumerator[0] = arrNumerator[1];
			arrDenominator[0] = arrDenominator[1];
		}
		arrNumerator[1] = arrNumerator[0] + arrNumerator[2];
		arrDenominator[1] = arrDenominator[0] + arrDenominator[2];
		
		return moveTree(sb, arrNumerator, arrDenominator, m, n);
	}
}
&lt;/textarea&gt;
&lt;br /&gt;
&lt;textarea class=&quot;brush:java&quot; title=&quot;Test&quot;&gt;package Problem039TheSternBrocotNumberSystem;

import static org.junit.Assert.*;

import org.junit.Test;

public class TheSternBrocotNumberSystemTest 
{
	@Test
	public void testGetTreeString() 
	{
		assertTrue(&quot;LRRL&quot;.equals(TheSternBrocotNumberSystem.getTreeString(5, 7)));
		assertTrue(&quot;RRLRRLRLLLLRLRRR&quot;.equals(TheSternBrocotNumberSystem.getTreeString(878, 323)));
	}

}
&lt;/textarea&gt;
&lt;/p&gt;

&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;맛보기 사진&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;a href=&quot;http://cfile23.uf.tistory.com/original/203CFC464E108BE53717C9&quot; rel=&quot;lightbox&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://cfile23.uf.tistory.com/image/203CFC464E108BE53717C9&quot; alt=&quot;&quot; filemime=&quot;&quot; filename=&quot;cfile23.uf@203CFC464E108BE53717C9.png&quot; height=&quot;326&quot; width=&quot;500&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;여담&lt;/span&gt;&lt;/span&gt;&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;분수를 계산할 때, 나누기보단, 곱하기를 이용해 더 빠르게 계산 가능하다.(공통분모 개념)&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;문제만 이해 되면, 답은 뭐 어떻게 해서든 낼 수 있으니, 전혀 어렵지 않았다.&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;입력 값 기준으로 역으로 루트까지 올라 가려 했으나, 공식 만들기 실패해서, 포기하고 루트에서 내려가도록 했다.&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;:wq!&lt;br /&gt;
&lt;/p&gt;&lt;div class=&quot;entry-ccl&quot; style=&quot;clear: both; text-align: right; margin-bottom: 10px&quot;&gt;
	&lt;img id=&quot;ccl-icon-1318-0&quot; class=&quot;entry-ccl-by&quot; src=&quot;http://i1.daumcdn.net/cfs.tistory/v/0/static/admin/editor/ccl_black01.png&quot; alt=&quot;저작자 표시&quot;/&gt;
	&lt;!--
	&lt;rdf:RDF xmlns=&quot;http://web.resource.org/cc/&quot; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot;&gt;
		&lt;Work rdf:about=&quot;&quot;&gt;
			&lt;license rdf:resource=&quot;http://creativecommons.org/licenses/by-fr/2.0/kr/&quot; /&gt;
		&lt;/Work&gt;
		&lt;License rdf:about=&quot;http://creativecommons.org/licenses/by-fr/&quot;&gt;
			&lt;permits rdf:resource=&quot;http://web.resource.org/cc/Reproduction&quot;/&gt;
			&lt;permits rdf:resource=&quot;http://web.resource.org/cc/Distribution&quot;/&gt;
			&lt;requires rdf:resource=&quot;http://web.resource.org/cc/Notice&quot;/&gt;
			&lt;requires rdf:resource=&quot;http://web.resource.org/cc/Attribution&quot;/&gt;
			&lt;permits rdf:resource=&quot;http://web.resource.org/cc/DerivativeWorks&quot;/&gt;
		&lt;/License&gt;
	&lt;/rdf:RDF&gt;
	--&gt;
&lt;/div&gt;
</description>
			<category>Programming Challenges : 알고리즘 트래이닝 북</category>
			<category>the stern-brocot number system</category>
			<category>uva 10077</category>
			<category>스턴-브로콧 수체계</category>
			<author>농사를 짓는 게임 프로그래머 최익필</author>
			<guid>http://ikpil.com/1318</guid>
			<comments>http://ikpil.com/1318#entry1318comment</comments>
			<pubDate>Sun, 03 Jul 2011 17:55:53 +0900</pubDate>
		</item>
		<item>
			<title>문제 38, 다항식의 계수, Polynomial Coefficients, PC/UVa ID : 110506/10105, 인기도 : B, 성공률 : 높음, 레벨 : 1</title>
			<link>http://ikpil.com/1317</link>
			<description>제 38, 다항식의 계수, Polynomial Coefficients, PC/UVa ID : 110506/10105, 인기도 : B, 성공률 : 높음, 레벨 : 1&lt;br /&gt;

&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;이 포스트를 만든 목적&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;생각 절차, 푼 방법, 고민거리 등을 기록하기 위해서 만들었다.&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;이 포스트의 준비물&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;Mozila Firefox 5.0 beta&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;eclipse 3.6.1 + vrapper&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;java&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;참조 문헌&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;스티븐 스키에나, 미구엘 레비야 저. Programming Challenges: 알고리즘 트레이닝 북. 서환수 역.&lt;br /&gt;
Springer. 한빛미디어 초판 2쇄 2004.12.05. (문제 38, 다항식의 계수, Polynomial Coefficients, p.158)&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;참조 링크&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt; &lt;a title=&quot;[http://acm.uva.es/p/v101/10105.html]로 이동합니다.&quot; target=&quot;_blank&quot; href=&quot;http://acm.uva.es/p/v101/10105.html&quot;&gt;http://acm.uva.es/p/v101/10105.html&lt;/a&gt; - 문제 원문&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;간략한 이야기/프로그램의 입출력&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;이 문제는 다항식 &lt;i&gt;(x&lt;sub&gt;1&lt;/sub&gt;+x&lt;sub&gt;2&lt;/sub&gt;+...+x&lt;sub&gt;k&lt;/sub&gt;)&lt;sup&gt;n&lt;/sup&gt;&lt;/i&gt;을 전개했을 때 계수를 구하는 것이다.&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;입력&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;여러 쌍의 줄이 입력된다. &lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;각 쌍의 첫번째 줄에는 두 개의 정수 n과 k가 있으며, 그 두 정수는 스페이스로 구분된다. (0&amp;lt;k, n&amp;lt;13)&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;n은 다항식의 제곱이고, k는 단항식의 갯수이다.&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;각 쌍의 두번째 줄에는 k개의 음이 아닌 정수 &lt;i&gt;n&lt;sub&gt;1&lt;/sub&gt;, ...,  n&lt;sub&gt;k&amp;nbsp; &lt;/sub&gt;&lt;/i&gt;수가 입력되며, 이때 &lt;i&gt;n&lt;sub&gt;1&lt;/sub&gt;+...+n&lt;sub&gt;k&lt;/sub&gt;=n&lt;/i&gt;

&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;&lt;/span&gt;&lt;/span&gt;이다.&lt;br /&gt;
이때 &lt;i&gt;n&lt;sub&gt;1&lt;/sub&gt;, ...,  n&lt;sub&gt;k&amp;nbsp;&lt;/sub&gt;&lt;/i&gt; 는 단항식의 각 문자의 지수를 뜻한다.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;출력&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;입력된 각 줄의 쌍에 대해 하나의 정수를 출력한다.&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;출력된 이 정수는 &lt;i&gt;(x&lt;sub&gt;1&lt;/sub&gt;+x&lt;sub&gt;2&lt;/sub&gt;+...+x&lt;sub&gt;k&lt;/sub&gt;)&lt;sup&gt;n &lt;/sup&gt;&lt;/i&gt;를 풀었을 때 나오는 &lt;i&gt;x&lt;sub&gt;1&lt;/sub&gt;&lt;sup&gt;n1&lt;/sup&gt;x&lt;sub&gt;2&lt;/sub&gt;&lt;sup&gt;n2&lt;/sup&gt;...x&lt;sub&gt;k&lt;/sub&gt;&lt;sup&gt;nk&lt;/sup&gt;&lt;/i&gt;의 계수이다.
&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;맛보기 코드&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;p&gt;
&lt;textarea class=&quot;brush:java&quot; title=&quot;Polynomial Coefficients&quot;&gt;package problem_038_polynomial_coefficients;

import java.util.*;

public class PolynomialCoefficients
{
    public static void main(String args[])
    {
        Scanner sc = new Scanner(System.in);
        for (;;)
        {
            if (false == sc.hasNextInt())
                break;
           
            int n = sc.nextInt();
            int k = sc.nextInt();
            if (n &amp;gt; 13 &amp;amp;&amp;amp; k &amp;lt; 0)
                break;
           
            int[] arrayK = getNumbericalIndex(sc, k);
            int[] fact = getFactorial13();
           
            int answer = getBinomialTheorem(fact, n, arrayK);
           
            System.out.println(answer);
        }
    }
   
    // 다항정리하고, 계수 얻기
    public static int getBinomialTheorem(int[] fact, int n, int[] arrayK)
    {
        int answer = fact[n];
       
        for (int i = 0; i &amp;lt; arrayK.length; ++i)
        {
            int ni = arrayK[i];
            if (1 &amp;lt; ni)
            {
                answer /= fact[ni];
            }
        }
       
        return answer;
    }
   
    // 단항식 지수 얻기
    public static int[] getNumbericalIndex(Scanner sc, int k)
    {
        int[] inputNumericalIndex = new int[k];
        for (int i = 0; i &amp;lt; k; ++i)
        {
            if (false == sc.hasNextInt())
                break;
           
            int ni = sc.nextInt();
            inputNumericalIndex[i] = ni;
        }
       
        return inputNumericalIndex;
    }
   
    //  팩토리얼
    public static int[] getFactorial13()
    {
        int[] fact = new int[14];
       
        fact[0] = 1;
        for (int i = 1; i &amp;lt;= 13; ++i)
            fact[i] = fact[i - 1] * i;
       
        return fact;
    }
}
&lt;/textarea&gt;&lt;br /&gt;
&lt;textarea class=&quot;brush:java&quot; title=&quot;Test&quot;&gt;package problem_038_polynomial_coefficients;

import static org.junit.Assert.*;

import org.junit.Test;

public class PolynomialCoefficientsTest
{
    int[] fact = PolynomialCoefficients.getFactorial13();
   
    @Test
    public void testGetBinomialTheorem()
    {
        assertTrue(2 == PolynomialCoefficients.getBinomialTheorem(fact, 2, new int[] {1, 1}));
        assertTrue(2 == PolynomialCoefficients.getBinomialTheorem(fact, 2, new int[] {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0}));
    }

}
&lt;/textarea&gt;
&lt;/p&gt;

&lt;p&gt;&lt;span style=&quot;font-weight: bold; font-size: 18pt;&quot;&gt;맛보기 사진&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;a href=&quot;http://cfile10.uf.tistory.com/original/13782F534E0FEF72170322&quot; rel=&quot;lightbox&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://cfile10.uf.tistory.com/image/13782F534E0FEF72170322&quot; alt=&quot;&quot; filemime=&quot;&quot; filename=&quot;cfile10.uf@13782F534E0FEF72170322.png&quot; height=&quot;327&quot; width=&quot;500&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;여담&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;수학1 에서 이항 정리에 대한 설명이 있다.&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;이 문제를 풀려면 &quot;다항 정리&quot;를 해야만 한다. (수학1에 간단하게 공식만 있다.)&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;문제 이해하는데 많은 시간이 걸렸고, 이해 후 풀려는데 다항정리가 필요하다는 것에 시간이 걸렸다.&lt;br /&gt;
&lt;/li&gt;&lt;li&gt;다른 사람이 푼것들, 답지를 보고 배울점은 팩토리얼의 최대치까지 미리 구해놓고 쓴다는 부분이다.&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
:wq!&lt;/p&gt;&lt;div class=&quot;entry-ccl&quot; style=&quot;clear: both; text-align: right; margin-bottom: 10px&quot;&gt;
	&lt;img id=&quot;ccl-icon-1317-0&quot; class=&quot;entry-ccl-by&quot; src=&quot;http://i1.daumcdn.net/cfs.tistory/v/0/static/admin/editor/ccl_black01.png&quot; alt=&quot;저작자 표시&quot;/&gt;
	&lt;!--
	&lt;rdf:RDF xmlns=&quot;http://web.resource.org/cc/&quot; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot;&gt;
		&lt;Work rdf:about=&quot;&quot;&gt;
			&lt;license rdf:resource=&quot;http://creativecommons.org/licenses/by-fr/2.0/kr/&quot; /&gt;
		&lt;/Work&gt;
		&lt;License rdf:about=&quot;http://creativecommons.org/licenses/by-fr/&quot;&gt;
			&lt;permits rdf:resource=&quot;http://web.resource.org/cc/Reproduction&quot;/&gt;
			&lt;permits rdf:resource=&quot;http://web.resource.org/cc/Distribution&quot;/&gt;
			&lt;requires rdf:resource=&quot;http://web.resource.org/cc/Notice&quot;/&gt;
			&lt;requires rdf:resource=&quot;http://web.resource.org/cc/Attribution&quot;/&gt;
			&lt;permits rdf:resource=&quot;http://web.resource.org/cc/DerivativeWorks&quot;/&gt;
		&lt;/License&gt;
	&lt;/rdf:RDF&gt;
	--&gt;
&lt;/div&gt;
</description>
			<category>Programming Challenges : 알고리즘 트래이닝 북</category>
			<category>polynomial coefficients</category>
			<category>uva 10105</category>
			<category>다항식의 계수</category>
			<author>농사를 짓는 게임 프로그래머 최익필</author>
			<guid>http://ikpil.com/1317</guid>
			<comments>http://ikpil.com/1317#entry1317comment</comments>
			<pubDate>Tue, 14 Jun 2011 01:53:04 +0900</pubDate>
		</item>
		<item>
			<title>최저임금제 이행 논란, 이유는?</title>
			<link>http://ikpil.com/1316</link>
			<description>&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;이 포스트를 만든 목적&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;기록&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;이 포스트의 준비물&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;Mozila Firefox 4&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;참조 정보&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;추적 60분, 999화, 2011.06.01 시급 4320원, 최저임금 왜 못 올리나&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a title=&quot;[http://blog.ohmynews.com/p01071136781/150578]로 이동합니다.&quot; target=&quot;_blank&quot; href=&quot;http://blog.ohmynews.com/p01071136781/150578&quot;&gt;http://blog.ohmynews.com/p01071136781/150578&lt;/a&gt; -- 폐지 주장&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;

&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;사건 요약&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;정책&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ol style=&quot;list-style-type: decimal;&quot;&gt;
&lt;li&gt;&lt;a title=&quot;[http://ko.wikipedia.org/wiki/%EC%B5%9C%EC%A0%80%EC%9E%84%EA%B8%88]로 이동합니다.&quot; target=&quot;_blank&quot; href=&quot;http://ko.wikipedia.org/wiki/%EC%B5%9C%EC%A0%80%EC%9E%84%EA%B8%88&quot;&gt;http://ko.wikipedia.org/wiki/최저임금&lt;/a&gt;&lt;br /&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold; font-size: 14pt;&quot;&gt;&lt;span&gt;최저임금제 이행 논란&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ol style=&quot;list-style-type: decimal;&quot;&gt;
&lt;li&gt;노동 구매자는 싸게 사고 싶고, 노동 판매자는 비싸게 노동을 팔고 싶어 한다. &lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;대부분 구조상 노동 구매자가 더 유리한 위치에 있기 때문에 노동 구매자는 더 싸게 노동을 구입할 수 있다. &lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;노동 판매자는 노동을 기본 생활도 보장받지 못할 금액으로 판매 되었다.&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;결국 노동 판매자의 생활을 보장하기 위해 1988년 1월 1일부터 &quot;최저임금법&quot;이 시행 되었다.&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;최저임금법으로 노동의 최저값이 결정 되었지만, 노동 구매자의 여건에 따라 이 법이 지켜지지 않게됨&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;매년 최저임금이 인상되고, 인상에 따라 2011년 250만명 가량이 최저임금도 못받게 됨&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;국가에 이 사실을 알려도, 국가가 강제하지 못함&lt;br /&gt;
- 나는 이 사실을 이해할 수 없다. 뭔가 있긴 있겠는데, 그게 뭐기 때문에 강제하지 못하는 걸까?&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;노동 구매자의 입장&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;최저임금 까지 올려줄 돈 없음&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;영세 자영업자들 망함&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;최저임금은 기본 생활까지 보장해 주는게 아님 &lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;노동 판매자의 입장&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;현재의 급여로는 생활 자체가 안됨&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;최저임금도 안되는 돈으로 도저히 생활 + 미래 투자 까지 못함&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;이행 못하는 문제의 병목&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;노동 구매자가 지불 능력이 있음에도 아까워 지불하지 않는 병목&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;원청의 하청, 하청의 하청 구조에서 오는 비용부담 병목&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;여담&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;이 문제는 시장논리만으로 풀기에는 무리가 있다. 왜냐하면, 한 사람이 그 사회에서 열심히 일을 했는데, 그 사회에서 기본 생활도 안되는 돈을 번다면, 그 사람은 그 사회에서 살아갈 수 없기 때문이다.&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;미용실에서 하루 15시간, 16시간 일할 때가 있는데, 한달간 55만원 받는다는데, 왜 이 일을 할수 밖에 없지? 그리고 무슨 일이길래 55만원이야?&lt;br /&gt;
&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;원청의 하청, 하청의 하청의 문제는 비정규직 문제와 연결된다.&lt;br /&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;:wq!&lt;br /&gt;
&lt;/p&gt;&lt;div class=&quot;entry-ccl&quot; style=&quot;clear: both; text-align: right; margin-bottom: 10px&quot;&gt;
	&lt;img id=&quot;ccl-icon-1316-0&quot; class=&quot;entry-ccl-by&quot; src=&quot;http://i1.daumcdn.net/cfs.tistory/v/0/static/admin/editor/ccl_black01.png&quot; alt=&quot;저작자 표시&quot;/&gt;
	&lt;!--
	&lt;rdf:RDF xmlns=&quot;http://web.resource.org/cc/&quot; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot;&gt;
		&lt;Work rdf:about=&quot;&quot;&gt;
			&lt;license rdf:resource=&quot;http://creativecommons.org/licenses/by-fr/2.0/kr/&quot; /&gt;
		&lt;/Work&gt;
		&lt;License rdf:about=&quot;http://creativecommons.org/licenses/by-fr/&quot;&gt;
			&lt;permits rdf:resource=&quot;http://web.resource.org/cc/Reproduction&quot;/&gt;
			&lt;permits rdf:resource=&quot;http://web.resource.org/cc/Distribution&quot;/&gt;
			&lt;requires rdf:resource=&quot;http://web.resource.org/cc/Notice&quot;/&gt;
			&lt;requires rdf:resource=&quot;http://web.resource.org/cc/Attribution&quot;/&gt;
			&lt;permits rdf:resource=&quot;http://web.resource.org/cc/DerivativeWorks&quot;/&gt;
		&lt;/License&gt;
	&lt;/rdf:RDF&gt;
	--&gt;
&lt;/div&gt;
</description>
			<category>시사</category>
			<category>최저임금제 이행 논란</category>
			<author>농사를 짓는 게임 프로그래머 최익필</author>
			<guid>http://ikpil.com/1316</guid>
			<comments>http://ikpil.com/1316#entry1316comment</comments>
			<pubDate>Fri, 03 Jun 2011 02:50:18 +0900</pubDate>
		</item>
		<item>
			<title>부산 저축은행 영업정지 사태</title>
			<link>http://ikpil.com/1315</link>
			<description>&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;이 포스트를 만든 목적&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;기록&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;이 포스트의 준비물&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;Mozila Firefox 4&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;참조 정보&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;PD 수첩 894회, 2011.05.31 고객 돈이 내 돈, 부산저축은행 보고서&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a title=&quot;[http://news.donga.com/Economy/Money/3/0102/20110601/37686495/1]로 이동합니다.&quot; target=&quot;_blank&quot; href=&quot;http://news.donga.com/Economy/Money/3/0102/20110601/37686495/1&quot;&gt;http://news.donga.com/Economy/Money/3/0102/20110601/37686495/1&lt;/a&gt; -- 시간상 잘 정리 되었음&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;

&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;사건 요약&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;전제 상황, 정책&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;제1 금융권에 사치성 업종, 유흥업 관련 대출 허용&lt;br /&gt;
- 언제부터 제1 금융권이 사치성 업종, 유흥업 관련 대출을 막았는지 조사할수 없었음&lt;br /&gt;
- 이 정책으로 제2 금융권 고유의 대출 대상이 제1 금융권에도 개방되어, 저축은행 수익성 악화&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;저축은행간 인수 허용 - 2005년 12월&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;88클럽 멤버일 경우, 여신한도 완화 제도 도입 - 2006년 8월&lt;br /&gt;
- 이것으로, 88클럽 멤버일 경우, 대출이 더 쉽게, 더 많이 해줄수 있게 됨&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;PF 대출 취급 규정 마련 - 2007년 6월&lt;br /&gt;
- PF 대출이 좀더 쉬어짐&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;부실 저축은행 인수합병에 인센티브 제공 - 2008년 9월&lt;br /&gt;
- &lt;a title=&quot;[http://www.vop.co.kr/A00000219359.html]로 이동합니다.&quot; target=&quot;_blank&quot; href=&quot;http://www.vop.co.kr/A00000219359.html&quot;&gt;http://www.vop.co.kr/A00000219359.html&lt;/a&gt;&lt;br /&gt;
- &lt;a title=&quot;[http://www2.seoul.co.kr/news/newsView.php?id=20080821017012]로 이동합니다.&quot; target=&quot;_blank&quot; href=&quot;http://www2.seoul.co.kr/news/newsView.php?id=20080821017012&quot;&gt;http://www2.seoul.co.kr/news/newsView.php?id=20080821017012&lt;/a&gt;&lt;br /&gt;
- 좋은 방향보단 부산저축은행이 부실 저축은행을 인수하면서 부실규모를 더 키움&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;부산 저축은행 영업정지 사태&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;정책적으로 대출 규제가 완화되는 방향 이었으나, 부산 저축은행의 경우, 범죄로써 악용하여, 사회적 파장이 더 크다. 저축은행과 특수관계가 있는 인물은 대출을 할수 없는 법이 있음에도, 명의 대여를 하여, 대주주등 저축은행과 특수관련이 있는 인물들이 SPC(특수목적법인) 120여개를 세우고, 4조 5942억을 담보없이 대출을 하였음&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;SPC가 대부분 망하게 됨에 따라, 대출금 회수가 불가능해 지고, 부산 저축은행은 유동성이 악화(은행이 돈이 없어, 영업을 못함)되어, 금융감독원에 의해 영업정지가 내려짐&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;결국 3만여명의 예금자의 5천만원 초과 금액과 및 후순위 채권의 돈은 전부 잃어버리게 됨&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;문제점&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;금융감독원의 감독 활동 실패&lt;br /&gt;
- 금융감독원이라 할지라도 감독 실패함을 보여줌&lt;br /&gt;
- 금융감독원도 압력엔 무릎을 꿇는 것을 보여줌&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;저축은행의 무조건적인 신뢰&lt;br /&gt;
- 저축은행이라 할지라도 언제든지 예금자를 등쳐먹는 방법을 보여줌&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;2005년부터 시작된 정책 실패&lt;br /&gt;
- 좋은 정책으로 보여도, 정책 이용자가 악용하면, 끝도 없이 악용됨을 보여줌&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;의문점&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;담보없이 저렇게 까지 대출 해주는데, 어떻게 감독이 실패할수 있지?&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold; font-size: 14pt;&quot;&gt;여담&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;예금자 보호 금액의 95%까지만 제2금융권에 저축해야 겠다.&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;경제 관련 정책에 대해서 ... 연관관계가 몹시 많아 다 연결했을 때, 어떤 예측(정보)까 나올지 모르겠다.&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;:wq!&lt;br /&gt;
&lt;/p&gt;&lt;div class=&quot;entry-ccl&quot; style=&quot;clear: both; text-align: right; margin-bottom: 10px&quot;&gt;
	&lt;img id=&quot;ccl-icon-1315-0&quot; class=&quot;entry-ccl-by&quot; src=&quot;http://i1.daumcdn.net/cfs.tistory/v/0/static/admin/editor/ccl_black01.png&quot; alt=&quot;저작자 표시&quot;/&gt;
	&lt;!--
	&lt;rdf:RDF xmlns=&quot;http://web.resource.org/cc/&quot; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot;&gt;
		&lt;Work rdf:about=&quot;&quot;&gt;
			&lt;license rdf:resource=&quot;http://creativecommons.org/licenses/by-fr/2.0/kr/&quot; /&gt;
		&lt;/Work&gt;
		&lt;License rdf:about=&quot;http://creativecommons.org/licenses/by-fr/&quot;&gt;
			&lt;permits rdf:resource=&quot;http://web.resource.org/cc/Reproduction&quot;/&gt;
			&lt;permits rdf:resource=&quot;http://web.resource.org/cc/Distribution&quot;/&gt;
			&lt;requires rdf:resource=&quot;http://web.resource.org/cc/Notice&quot;/&gt;
			&lt;requires rdf:resource=&quot;http://web.resource.org/cc/Attribution&quot;/&gt;
			&lt;permits rdf:resource=&quot;http://web.resource.org/cc/DerivativeWorks&quot;/&gt;
		&lt;/License&gt;
	&lt;/rdf:RDF&gt;
	--&gt;
&lt;/div&gt;
</description>
			<category>시사</category>
			<category>부산저축은행 영업정지 사태</category>
			<author>농사를 짓는 게임 프로그래머 최익필</author>
			<guid>http://ikpil.com/1315</guid>
			<comments>http://ikpil.com/1315#entry1315comment</comments>
			<pubDate>Wed, 01 Jun 2011 22:44:47 +0900</pubDate>
		</item>
		<item>
			<title>자바로 서버 만들기 준비중...</title>
			<link>http://ikpil.com/1314</link>
			<description>&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;이 포스트를 만든 목적&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;기록&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;이 포스트의 준비물&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;Mozila Firefox 4&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;eclipse 3.6.1 + vrapper&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;java, sdk&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;참조 링크&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;

&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;&lt;a title=&quot;[http://shonm.tistory.com/entry/byte-%EB%A1%9C-%EB%B0%9B%EC%9D%80-%EB%8D%B0%EC%9D%B4%ED%84%B0-String-%EC%9C%BC%EB%A1%9C-%EB%B0%94%EA%BE%B8%EA%B8%B0]로 이동합니다.&quot; target=&quot;_blank&quot; href=&quot;http://shonm.tistory.com/entry/byte-%EB%A1%9C-%EB%B0%9B%EC%9D%80-%EB%8D%B0%EC%9D%B4%ED%84%B0-String-%EC%9C%BC%EB%A1%9C-%EB%B0%94%EA%BE%B8%EA%B8%B0&quot;&gt;http://shonm.tistory.com/entry/byte-로-받은-데이터-String-으로-바꾸기&lt;/a&gt; -- byte 를 String 으로 바꾸는 방법&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;text-decoration: underline;&quot;&gt;&lt;a title=&quot;[http://www.ezslookingaround.com/blog/tech/?no=1419]로 이동합니다.&quot; target=&quot;_blank&quot; href=&quot;http://www.ezslookingaround.com/blog/tech/?no=1419&quot;&gt;http://www.ezslookingaround.com/blog/tech/?no=1419&lt;/a&gt;&lt;/span&gt; -- java selector api 설명&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;text-decoration: underline;&quot;&gt;&lt;a title=&quot;[http://download.oracle.com/javase/6/docs/api/]로 이동합니다.&quot; target=&quot;_blank&quot; href=&quot;http://download.oracle.com/javase/6/docs/api/&quot;&gt;http://download.oracle.com/javase/6/docs/api/&lt;/a&gt;&lt;/span&gt; -- java se api&lt;br /&gt;
&lt;/li&gt;&lt;li&gt;&lt;a title=&quot;[http://download.oracle.com/javase/6/docs/technotes/guides/io/example/index.html]로 이동합니다.&quot; target=&quot;_blank&quot; href=&quot;http://download.oracle.com/javase/6/docs/technotes/guides/io/example/index.html&quot;&gt;http://download.oracle.com/javase/6/docs/technotes/guides/io/example/index.html&lt;/a&gt; -- nio examples&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;맛보기 사진&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;a href=&quot;http://cfile10.uf.tistory.com/original/17358E564DD93B70094B9C&quot; rel=&quot;lightbox&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://cfile10.uf.tistory.com/image/17358E564DD93B70094B9C&quot; alt=&quot;&quot; filemime=&quot;&quot; filename=&quot;cfile10.uf@17358E564DD93B70094B9C.png&quot; height=&quot;302&quot; width=&quot;500&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;여담&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;문서 좀 더 찾아 봐서 예외처리에 대해서 처리 해 두어야겠다.&lt;br /&gt;
&lt;/li&gt;&lt;li&gt;전체 만들어 보고, 순차적으로 기록해 두어야 겠다. &lt;br /&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;&lt;br /&gt;
&lt;/p&gt;&lt;div class=&quot;entry-ccl&quot; style=&quot;clear: both; text-align: right; margin-bottom: 10px&quot;&gt;
	&lt;img id=&quot;ccl-icon-1314-0&quot; class=&quot;entry-ccl-by&quot; src=&quot;http://i1.daumcdn.net/cfs.tistory/v/0/static/admin/editor/ccl_black01.png&quot; alt=&quot;저작자 표시&quot;/&gt;
	&lt;!--
	&lt;rdf:RDF xmlns=&quot;http://web.resource.org/cc/&quot; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot;&gt;
		&lt;Work rdf:about=&quot;&quot;&gt;
			&lt;license rdf:resource=&quot;http://creativecommons.org/licenses/by-fr/2.0/kr/&quot; /&gt;
		&lt;/Work&gt;
		&lt;License rdf:about=&quot;http://creativecommons.org/licenses/by-fr/&quot;&gt;
			&lt;permits rdf:resource=&quot;http://web.resource.org/cc/Reproduction&quot;/&gt;
			&lt;permits rdf:resource=&quot;http://web.resource.org/cc/Distribution&quot;/&gt;
			&lt;requires rdf:resource=&quot;http://web.resource.org/cc/Notice&quot;/&gt;
			&lt;requires rdf:resource=&quot;http://web.resource.org/cc/Attribution&quot;/&gt;
			&lt;permits rdf:resource=&quot;http://web.resource.org/cc/DerivativeWorks&quot;/&gt;
		&lt;/License&gt;
	&lt;/rdf:RDF&gt;
	--&gt;
&lt;/div&gt;
</description>
			<category>잡담</category>
			<author>농사를 짓는 게임 프로그래머 최익필</author>
			<guid>http://ikpil.com/1314</guid>
			<comments>http://ikpil.com/1314#entry1314comment</comments>
			<pubDate>Mon, 23 May 2011 01:38:37 +0900</pubDate>
		</item>
		<item>
			<title>문제 37, 곱하기 게임, A Multiplication Game, PC/UVa ID : 110505/847, 인기도 : A, 성공률 : 높음, 레벨 : 3</title>
			<link>http://ikpil.com/1313</link>
			<description>&lt;p&gt;문제 37, 곱하기 게임, A Multiplication Game, PC/UVa ID : 110505/847, 인기도 : A, 성공률 : 높음, 레벨 : 3&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;이 포스트를 만든 목적&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;생각 절차, 푼 방법, 고민거리 등을 기록하기 위해서 만들었다.&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;이 포스트의 준비물&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;Mozila Firefox 4&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;eclipse 3.6.1 + vrapper&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;java&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;참조 문헌&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;스티븐 스키에나, 미구엘 레비야 저. Programming Challenges: 알고리즘 트레이닝 북. 서환수 역.&lt;br /&gt;
Springer. 한빛미디어 초판 2쇄 2004.12.05. (문제 37, A Multiplication Game, p.157)&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;참조 링크&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;text-decoration: underline;&quot;&gt;&lt;/span&gt;&lt;a title=&quot;[http://online-judge.uva.es/p/v8/847.html]로 이동합니다.&quot; target=&quot;_blank&quot; href=&quot;http://online-judge.uva.es/p/v8/847.html&quot;&gt; http://online-judge.uva.es/p/v8/847.html&lt;/a&gt; : 문제 원문&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a title=&quot;[http://cherrykyun.tistory.com/197]로 이동합니다.&quot; target=&quot;_blank&quot; href=&quot;http://cherrykyun.tistory.com/197&quot;&gt;http://cherrykyun.tistory.com/197&lt;/a&gt;&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a title=&quot;[http://tausiq.wordpress.com/2009/10/05/acm-uva-847/]로 이동합니다.&quot; target=&quot;_blank&quot; href=&quot;http://tausiq.wordpress.com/2009/10/05/acm-uva-847/&quot;&gt;http://tausiq.wordpress.com/2009/10/05/acm-uva-847/&lt;/a&gt;&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;간략한 이야기/프로그램의 입출력&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;
스탠(Stan)과 올리(Ollie)가 정수 2 &amp;lt;= p &amp;lt;= 9 하나를 곱하는 곱하기 게임을 한다. 항상 가장 먼저 게임을 시작하는 것은 스탠으로, p = 1 에서 시작해서 곱하기를 한다. 그러면 올리는 그 수를 받아서 곱셈을 한 다음 다시 스탬한테 순서를 넘기고, 이런 과정을 반복한다. 게임을 시작하기 전에 무작위로 1 &amp;lt;= n &amp;lt;= 4,294,967,295 정수를 하나 뽑는데, 둘 중에서 n 이상인 p를 먼저 만들어내는 사람이 게임의 승자가 된다.&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;입력&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;각 줄마다 정수 n이 하나씩 주어진다.&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;출력&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;각 입력 줄에 대해 다음 중 하나를 출력한다.&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Stan wins.&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Ollie wins.&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;이때 스탠과 올리는 모두 완벽하게 게임을 한다고 가정하자.&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;여담&lt;/span&gt;&lt;/span&gt;&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;못 풀었다.&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;완벽하게 게임을 한다는 뜻을 이해 못하겠다.&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;:wq!&lt;br /&gt;
&lt;/p&gt;&lt;div class=&quot;entry-ccl&quot; style=&quot;clear: both; text-align: right; margin-bottom: 10px&quot;&gt;
	&lt;img id=&quot;ccl-icon-1313-0&quot; class=&quot;entry-ccl-by&quot; src=&quot;http://i1.daumcdn.net/cfs.tistory/v/0/static/admin/editor/ccl_black01.png&quot; alt=&quot;저작자 표시&quot;/&gt;
	&lt;!--
	&lt;rdf:RDF xmlns=&quot;http://web.resource.org/cc/&quot; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot;&gt;
		&lt;Work rdf:about=&quot;&quot;&gt;
			&lt;license rdf:resource=&quot;http://creativecommons.org/licenses/by-fr/2.0/kr/&quot; /&gt;
		&lt;/Work&gt;
		&lt;License rdf:about=&quot;http://creativecommons.org/licenses/by-fr/&quot;&gt;
			&lt;permits rdf:resource=&quot;http://web.resource.org/cc/Reproduction&quot;/&gt;
			&lt;permits rdf:resource=&quot;http://web.resource.org/cc/Distribution&quot;/&gt;
			&lt;requires rdf:resource=&quot;http://web.resource.org/cc/Notice&quot;/&gt;
			&lt;requires rdf:resource=&quot;http://web.resource.org/cc/Attribution&quot;/&gt;
			&lt;permits rdf:resource=&quot;http://web.resource.org/cc/DerivativeWorks&quot;/&gt;
		&lt;/License&gt;
	&lt;/rdf:RDF&gt;
	--&gt;
&lt;/div&gt;
</description>
			<category>Programming Challenges : 알고리즘 트래이닝 북</category>
			<category>847</category>
			<category>A Multiplication Game</category>
			<category>IT</category>
			<category>곱하기 게임</category>
			<author>농사를 짓는 게임 프로그래머 최익필</author>
			<guid>http://ikpil.com/1313</guid>
			<comments>http://ikpil.com/1313#entry1313comment</comments>
			<pubDate>Sat, 07 May 2011 18:18:56 +0900</pubDate>
		</item>
	</channel>
</rss>

