<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2271741171932159121</id><updated>2011-11-27T16:50:44.441-08:00</updated><category term='11173'/><category term='xor'/><category term='32-bit integers'/><category term='GCD'/><category term='ci-tech'/><category term='solution'/><category term='tokenizing'/><category term='sample solution'/><category term='fgets'/><category term='10783'/><category term='Ecological Premium'/><category term='parsing'/><category term='incentive'/><category term='rare easy problem'/><category term='algorithms'/><category term='cartesian plane'/><category term='unsigned long long int'/><category term='problem difficulty'/><category term='UVA Online Judge'/><category term='validation'/><category term='iteration'/><category term='binary'/><category term='sum'/><category term='10865'/><category term='64-bit integers'/><category term='encryption'/><category term='getting input'/><category term='hint'/><category term='distance'/><category term='rejected submissions'/><category term='frustration'/><category term='parking'/><category term='strtok'/><category term='world of seven'/><category term='sort'/><category term='difference'/><category term='sample code'/><category term='environmental friendliness'/><category term='intersection'/><category term='finding easy problems'/><category term='gray codes'/><category term='10696'/><category term='government'/><category term='language'/><category term='easy problems'/><category term='programming tips'/><category term='11231'/><category term='algorithm'/><category term='maximum'/><category term='Canon Information Technologies Philippines'/><category term='int'/><category term='vertical'/><category term='Odd Sum'/><category term='steven halim'/><category term='right-shift'/><category term='multiplication'/><category term='large numbers'/><category term='10300'/><category term='carry bits'/><category term='problems'/><category term='computer programming'/><category term='hard problems'/><category term='Dev-C++'/><category term='left-shift'/><category term='bit-shift'/><category term='Noel Patron'/><category term='100'/><category term='statistics'/><category term='chess'/><category term='compiler'/><category term='recursion'/><category term='clue'/><category term='programming contests'/><category term='sample algorithm'/><category term='animals'/><category term='even numbers'/><category term='Ateneo de Manila University'/><category term='map'/><category term='passing lane'/><category term='programming algorithms'/><category term='overflow'/><category term='greatest common divisor'/><category term='bitwise xor'/><category term='10260'/><category term='2D hieroglyphs decoder'/><category term='string'/><category term='C++'/><category term='confuse'/><category term='big numbers'/><category term='archive'/><category term='quadrants'/><category term='programming competitions'/><category term='analysis'/><category term='bitwise AND'/><category term='power of 2'/><category term='euclidean algorithm'/><category term='horizontal'/><category term='Edward Bernardo'/><category term='trivia'/><category term='Brownie points'/><category term='10851'/><category term='Black and white painting'/><category term='F91'/><category term='programming competition'/><category term='code'/><category term='online submission'/><category term='file'/><category term='embedded chess boards'/><category term='stl'/><category term='for-loop'/><category term='rating'/><category term='cycle'/><category term='level'/><category term='programming'/><category term='3n + 1'/><category term='remainder'/><category term='standard input'/><category term='division algorithm'/><category term='tricky'/><category term='land area'/><category term='Java'/><category term='Google'/><category term='grey codes'/><category term='tip'/><category term='division'/><category term='computer algorithms'/><category term='wikipedia'/><category term='iterator'/><category term='words'/><category term='soundex'/><category term='10633'/><category term='11417'/><category term='standard template library'/><category term='11364'/><category term='pattern'/><category term='index'/><category term='to carry or not to carry'/><category term='article'/><category term='compiling'/><category term='mod'/><category term='10469'/><category term='answer'/><category term='Pascal'/><category term='Google search bar'/><category term='odd numbers'/><category term='problem'/><title type='text'>Algorithm Share</title><subtitle type='html'>We learn by sharing</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://algoshare.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://algoshare.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Algorithm Share</name><uri>http://www.blogger.com/profile/05122107953495341186</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>32</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2271741171932159121.post-1789794215315289550</id><published>2009-11-01T19:22:00.000-08:00</published><updated>2009-11-01T19:26:12.568-08:00</updated><title type='text'>11044: Searching for Nessy</title><content type='html'>&lt;pre&gt;&lt;br /&gt;000 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;001 &lt;br /&gt;002 int main() {&lt;br /&gt;003   char line[100];&lt;br /&gt;004   int i, t, n, m, nq, mq, nr, mr, s;&lt;br /&gt;005 &lt;br /&gt;006   fgets(line, 100, stdin);&lt;br /&gt;007   sscanf(line, "%d", &amp;t);&lt;br /&gt;008 &lt;br /&gt;009   for (i = 0; i &amp;lt; t; i += 1) {&lt;br /&gt;010     fgets(line, 100, stdin);&lt;br /&gt;011     sscanf(line, "%d %d", &amp;n, &amp;m);&lt;br /&gt;012 &lt;br /&gt;013     n -= 2;&lt;br /&gt;014     nq = n / 3;&lt;br /&gt;015     nr = n % 3;&lt;br /&gt;016     if (nr) {&lt;br /&gt;017       nq += 1;&lt;br /&gt;018     }&lt;br /&gt;019 &lt;br /&gt;020     m -= 2;&lt;br /&gt;021     mq = m / 3;&lt;br /&gt;022     mr = m % 3;&lt;br /&gt;023     if (mr) {&lt;br /&gt;024       mq += 1;&lt;br /&gt;025     }&lt;br /&gt;026 &lt;br /&gt;027     s = nq * mq;&lt;br /&gt;028     printf("%d\n", s);&lt;br /&gt;029   }&lt;br /&gt;030 &lt;br /&gt;031   return 0;&lt;br /&gt;032 }&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2271741171932159121-1789794215315289550?l=algoshare.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://algoshare.blogspot.com/feeds/1789794215315289550/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://algoshare.blogspot.com/2009/11/11044-searching-for-nessy.html#comment-form' title='34 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/1789794215315289550'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/1789794215315289550'/><link rel='alternate' type='text/html' href='http://algoshare.blogspot.com/2009/11/11044-searching-for-nessy.html' title='11044: Searching for Nessy'/><author><name>Algorithm Share</name><uri>http://www.blogger.com/profile/05122107953495341186</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>34</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2271741171932159121.post-702967427943429703</id><published>2009-11-01T16:35:00.000-08:00</published><updated>2009-11-01T16:52:35.560-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='standard template library'/><category scheme='http://www.blogger.com/atom/ns#' term='map'/><category scheme='http://www.blogger.com/atom/ns#' term='int'/><category scheme='http://www.blogger.com/atom/ns#' term='string'/><category scheme='http://www.blogger.com/atom/ns#' term='stl'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><category scheme='http://www.blogger.com/atom/ns#' term='sort'/><title type='text'>10420: List of Conquests</title><content type='html'>For this problem, a C++ standard map could be used where the country is used as the key and the number of women Don Giovanni loved in the corresponding country is used as the value. The C++ standard library map automatically sorts its key and value pairs in ascending order according to the keys. In effect, a straightforward iteration on the map yields an alphabetical traversal on the countries accumulated.&lt;br /&gt;&lt;br /&gt;Here's a sample implementation:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;000 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;001 #include &amp;lt;map&amp;gt;&lt;br /&gt;002 #include &amp;lt;iostream&amp;gt;&lt;br /&gt;003 #include &amp;lt;string&amp;gt;&lt;br /&gt;004 &lt;br /&gt;005 using namespace std;&lt;br /&gt;006 &lt;br /&gt;007 int main() {&lt;br /&gt;008   char line[100], ctmp[100];&lt;br /&gt;009   int n, i, j;&lt;br /&gt;010   map&amp;lt;string, int&amp;gt; countries;&lt;br /&gt;011   map&amp;lt;string, int&amp;gt;::iterator iter;&lt;br /&gt;012   &lt;br /&gt;013   fgets(line, 100, stdin);&lt;br /&gt;014   sscanf(line, "%d", &amp;n);&lt;br /&gt;015   &lt;br /&gt;016   for (i = 0; i &amp;lt; n; i += 1) { &lt;br /&gt;017     fgets(line, 100, stdin);&lt;br /&gt;018     &lt;br /&gt;019     for (j = 0; 1; j += 1) {&lt;br /&gt;020       if (line[j] == ' ') {&lt;br /&gt;021         break;&lt;br /&gt;022       }&lt;br /&gt;023       ctmp[j] = line[j];&lt;br /&gt;024     }&lt;br /&gt;025     ctmp[j] = 0;&lt;br /&gt;026     &lt;br /&gt;027     countries[ctmp] += 1;&lt;br /&gt;028   }&lt;br /&gt;029   &lt;br /&gt;030   for (iter = countries.begin(); iter != countries.end(); ++iter) {&lt;br /&gt;031     cout &amp;lt;&amp;lt; iter-&amp;gt;first &amp;lt;&amp;lt; " " &amp;lt;&amp;lt; iter-&amp;gt;second &amp;lt;&amp;lt; endl;&lt;br /&gt;032   }&lt;br /&gt;033 &lt;br /&gt;034   return 0;&lt;br /&gt;035 }&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2271741171932159121-702967427943429703?l=algoshare.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://algoshare.blogspot.com/feeds/702967427943429703/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://algoshare.blogspot.com/2009/11/10420-list-of-conquests.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/702967427943429703'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/702967427943429703'/><link rel='alternate' type='text/html' href='http://algoshare.blogspot.com/2009/11/10420-list-of-conquests.html' title='10420: List of Conquests'/><author><name>Algorithm Share</name><uri>http://www.blogger.com/profile/05122107953495341186</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2271741171932159121.post-7364053895920445716</id><published>2009-11-01T01:25:00.000-07:00</published><updated>2009-11-01T01:27:24.446-08:00</updated><title type='text'>10361: Automatic Poetry</title><content type='html'>&lt;pre&gt;&lt;br /&gt;#include "stdio.h"&lt;br /&gt;&lt;br /&gt;int main() {&lt;br /&gt;  char line[100], s1[100], s2[100], s3[100], s4[100], s5[100];&lt;br /&gt;  char l1[100], l2[100];&lt;br /&gt;  int i, j, k, n, q;&lt;br /&gt;  &lt;br /&gt;  fgets(line, 100, stdin);&lt;br /&gt;  sscanf(line, "%d", &amp;n);&lt;br /&gt;  &lt;br /&gt;  for (i = 0; i &amp;lt n; i += 1) {&lt;br /&gt;    s1[0] = 0;&lt;br /&gt;    s2[0] = 0;&lt;br /&gt;    s3[0] = 0;&lt;br /&gt;    s4[0] = 0;&lt;br /&gt;    s5[0] = 0; &lt;br /&gt;&lt;br /&gt;    fgets(line, 100, stdin);&lt;br /&gt;    &lt;br /&gt;    for (j = 0, k = 0, q = 0; 1; j += 1, k += 1, q += 1) {&lt;br /&gt;      if (line[j] == '&amp;lt') {&lt;br /&gt;        break;&lt;br /&gt;      }&lt;br /&gt;      s1[k] = line[j];&lt;br /&gt;      l1[q] = line[j];      &lt;br /&gt;    }&lt;br /&gt;    s1[k] = 0;&lt;br /&gt;    j += 1;&lt;br /&gt;    &lt;br /&gt;    for (k = 0; 1; j += 1, k += 1, q += 1) {&lt;br /&gt;      if (line[j] == '&amp;gt') {&lt;br /&gt;        break;&lt;br /&gt;      }&lt;br /&gt;      s2[k] = line[j];&lt;br /&gt;      l1[q] = line[j];      &lt;br /&gt;    }&lt;br /&gt;    s2[k] = 0;&lt;br /&gt;    j += 1;&lt;br /&gt;&lt;br /&gt;    for (k = 0; 1; j += 1, k += 1, q += 1) {&lt;br /&gt;      if (line[j] == '&amp;lt') {&lt;br /&gt;        break;&lt;br /&gt;      }&lt;br /&gt;      s3[k] = line[j];&lt;br /&gt;      l1[q] = line[j];      &lt;br /&gt;    }&lt;br /&gt;    s3[k] = 0;&lt;br /&gt;    j += 1;&lt;br /&gt;    &lt;br /&gt;    for (k = 0; 1; j += 1, k += 1, q += 1) {&lt;br /&gt;      if (line[j] == '&amp;gt') {&lt;br /&gt;        break;&lt;br /&gt;      }&lt;br /&gt;      s4[k] = line[j];&lt;br /&gt;      l1[q] = line[j];      &lt;br /&gt;    }&lt;br /&gt;    s4[k] = 0;&lt;br /&gt;    j += 1;&lt;br /&gt;    &lt;br /&gt;    for (k = 0; 1; j += 1, k += 1, q += 1) {&lt;br /&gt;      if (line[j] == '0' || line[j] == '\n') {&lt;br /&gt;        break;&lt;br /&gt;      }&lt;br /&gt;      s5[k] = line[j];&lt;br /&gt;      l1[q] = line[j];      &lt;br /&gt;    }&lt;br /&gt;    s5[k] = 0;&lt;br /&gt;    l1[q] = 0;&lt;br /&gt;    &lt;br /&gt;    fgets(line, 100, stdin);&lt;br /&gt;    &lt;br /&gt;    for (j = 0; 1; j += 1) {&lt;br /&gt;      if (line[j] == '.') {&lt;br /&gt;        break;&lt;br /&gt;      }&lt;br /&gt;      l2[j] = line[j];&lt;br /&gt;    }&lt;br /&gt;    l2[j] = 0;&lt;br /&gt;    &lt;br /&gt;    printf("%s\n", l1);&lt;br /&gt;    printf("%s%s%s%s%s\n", l2, s4, s3, s2, s5);   &lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  return 0;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2271741171932159121-7364053895920445716?l=algoshare.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://algoshare.blogspot.com/feeds/7364053895920445716/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://algoshare.blogspot.com/2009/11/10361-automatic-poetry.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/7364053895920445716'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/7364053895920445716'/><link rel='alternate' type='text/html' href='http://algoshare.blogspot.com/2009/11/10361-automatic-poetry.html' title='10361: Automatic Poetry'/><author><name>Algorithm Share</name><uri>http://www.blogger.com/profile/05122107953495341186</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2271741171932159121.post-6642217858094616356</id><published>2009-01-30T11:55:00.000-08:00</published><updated>2009-01-30T11:58:13.853-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='UVA Online Judge'/><category scheme='http://www.blogger.com/atom/ns#' term='map'/><category scheme='http://www.blogger.com/atom/ns#' term='problem'/><category scheme='http://www.blogger.com/atom/ns#' term='soundex'/><category scheme='http://www.blogger.com/atom/ns#' term='sample code'/><category scheme='http://www.blogger.com/atom/ns#' term='sample solution'/><category scheme='http://www.blogger.com/atom/ns#' term='10260'/><category scheme='http://www.blogger.com/atom/ns#' term='sample algorithm'/><title type='text'>UVa problem 10260: sample algorithm sample code</title><content type='html'>To solve UVa problem 10260 (Soundex), one could use a map to map characters to their integer values.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;001 #include "stdio.h"&lt;br /&gt;002 #include "map"&lt;br /&gt;003 &lt;br /&gt;004 using namespace std;&lt;br /&gt;005 &lt;br /&gt;006 int main() {&lt;br /&gt;007   char line[100], ctmp[100], dtmp[100];&lt;br /&gt;008 &lt;br /&gt;009   int i, j, prev, len, arr[20];&lt;br /&gt;010 &lt;br /&gt;011   map&lt;char, int&gt; m;&lt;br /&gt;012   map&lt;char, int&gt;::iterator mi;&lt;br /&gt;013 &lt;br /&gt;014   m['B'] = 1;&lt;br /&gt;015   m['F'] = 1;&lt;br /&gt;016   m['P'] = 1;&lt;br /&gt;017   m['V'] = 1;&lt;br /&gt;018 &lt;br /&gt;019   m['C'] = 2;&lt;br /&gt;020   m['G'] = 2;&lt;br /&gt;021   m['J'] = 2;&lt;br /&gt;022   m['K'] = 2;&lt;br /&gt;023   m['Q'] = 2;&lt;br /&gt;024   m['S'] = 2;&lt;br /&gt;025   m['X'] = 2;&lt;br /&gt;026   m['Z'] = 2;&lt;br /&gt;027 &lt;br /&gt;028   m['D'] = 3;&lt;br /&gt;029   m['T'] = 3;&lt;br /&gt;030 &lt;br /&gt;031   m['L'] = 4;&lt;br /&gt;032 &lt;br /&gt;033   m['M'] = 5;&lt;br /&gt;034   m['N'] = 5;&lt;br /&gt;035 &lt;br /&gt;036   m['R'] = 6;&lt;br /&gt;037 &lt;br /&gt;038   while (fgets(line, 100, stdin)) {&lt;br /&gt;039     for (i = 0, j = 0, prev = 0, len = 0; line[i] != 0; i++) {&lt;br /&gt;040       mi = m.find(line[i]);&lt;br /&gt;041       &lt;br /&gt;042       if (mi != m.end()) {&lt;br /&gt;043         j = (*mi).second;&lt;br /&gt;044 &lt;br /&gt;045         if (j == prev) {&lt;br /&gt;046           continue;&lt;br /&gt;047         }&lt;br /&gt;048 &lt;br /&gt;049         arr[len] = j;&lt;br /&gt;050         len++;&lt;br /&gt;051         prev = j;&lt;br /&gt;052       }&lt;br /&gt;053       else {&lt;br /&gt;054         prev = 0;&lt;br /&gt;055       }&lt;br /&gt;056     }&lt;br /&gt;057 &lt;br /&gt;058     for (i = 0; i &lt; len; i++) {&lt;br /&gt;059       printf("%d", arr[i]);&lt;br /&gt;060     }&lt;br /&gt;061     printf("\n", ctmp);&lt;br /&gt;062   }&lt;br /&gt;063 &lt;br /&gt;064   return 0;&lt;br /&gt;065 }&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2271741171932159121-6642217858094616356?l=algoshare.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://algoshare.blogspot.com/feeds/6642217858094616356/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://algoshare.blogspot.com/2009/01/uva-problem-10260-sample-algorithm.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/6642217858094616356'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/6642217858094616356'/><link rel='alternate' type='text/html' href='http://algoshare.blogspot.com/2009/01/uva-problem-10260-sample-algorithm.html' title='UVa problem 10260: sample algorithm sample code'/><author><name>Algorithm Share</name><uri>http://www.blogger.com/profile/05122107953495341186</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2271741171932159121.post-3657902773060074126</id><published>2009-01-30T04:24:00.001-08:00</published><updated>2009-01-30T04:28:38.963-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='UVA Online Judge'/><category scheme='http://www.blogger.com/atom/ns#' term='world of seven'/><category scheme='http://www.blogger.com/atom/ns#' term='rating'/><category scheme='http://www.blogger.com/atom/ns#' term='level'/><category scheme='http://www.blogger.com/atom/ns#' term='steven halim'/><category scheme='http://www.blogger.com/atom/ns#' term='finding easy problems'/><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><category scheme='http://www.blogger.com/atom/ns#' term='easy problems'/><category scheme='http://www.blogger.com/atom/ns#' term='problem difficulty'/><title type='text'>An easier way to find easy problems</title><content type='html'>An easier way to find easy problems in the UVa Online Judge is to use Steven Halim's World of Seven website. His website can be easily searched through Google. Figure 1 shows an excerpt from his website.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_2PJwbgod-iA/SYLxiLn6cVI/AAAAAAAAADc/bkU0WAumrEM/s1600-h/pic1.JPG"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 251px;" src="http://3.bp.blogspot.com/_2PJwbgod-iA/SYLxiLn6cVI/AAAAAAAAADc/bkU0WAumrEM/s400/pic1.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5297061681279168850" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 1. Illustration from World of Seven website for finding easy problems.&lt;br /&gt;&lt;br /&gt;From Figure 1, we see that some problems are rated 7.0, 8.0, 2.0, 5.5, 2.5, etc. Generally, the lower the rating the easier the problem is. So if you want to find an easy problem, choose a rating number that is as close to 0 as possible.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2271741171932159121-3657902773060074126?l=algoshare.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://algoshare.blogspot.com/feeds/3657902773060074126/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://algoshare.blogspot.com/2009/01/easier-way-to-find-easy-problems.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/3657902773060074126'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/3657902773060074126'/><link rel='alternate' type='text/html' href='http://algoshare.blogspot.com/2009/01/easier-way-to-find-easy-problems.html' title='An easier way to find easy problems'/><author><name>Algorithm Share</name><uri>http://www.blogger.com/profile/05122107953495341186</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_2PJwbgod-iA/SYLxiLn6cVI/AAAAAAAAADc/bkU0WAumrEM/s72-c/pic1.JPG' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2271741171932159121.post-4796242667171587716</id><published>2009-01-30T04:15:00.000-08:00</published><updated>2009-01-30T04:21:26.504-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='UVA Online Judge'/><category scheme='http://www.blogger.com/atom/ns#' term='10469'/><category scheme='http://www.blogger.com/atom/ns#' term='to carry or not to carry'/><category scheme='http://www.blogger.com/atom/ns#' term='sample code'/><category scheme='http://www.blogger.com/atom/ns#' term='binary'/><category scheme='http://www.blogger.com/atom/ns#' term='sample solution'/><category scheme='http://www.blogger.com/atom/ns#' term='sample algorithm'/><category scheme='http://www.blogger.com/atom/ns#' term='carry bits'/><category scheme='http://www.blogger.com/atom/ns#' term='bitwise xor'/><title type='text'>UVa problem 10469: sample algorithm, sample code</title><content type='html'>To solve 10469 (To carry or not to carry), one needs to be able to discover that in order to get the sum without the carry-bits, one simply has to perform a bitwise xor operation on the two numbers.&lt;br /&gt;&lt;br /&gt;XOR is simply the following formulat:&lt;br /&gt;0 ^ 0 = 0&lt;br /&gt;0 ^ 1 = 1&lt;br /&gt;1 ^ 0 = 1&lt;br /&gt;1 ^ 1 = 1&lt;br /&gt;&lt;br /&gt;For example, for 4 XOR 6, we have to represent them in binary as follows:&lt;br /&gt;4: 100&lt;br /&gt;6: 110&lt;br /&gt;______&lt;br /&gt;2: 010&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;001 #include "stdio.h"&lt;br /&gt;002 &lt;br /&gt;003 int main() {&lt;br /&gt;004   char line[100];&lt;br /&gt;005 &lt;br /&gt;006   int i, j;&lt;br /&gt;007 &lt;br /&gt;008   while (fgets(line, 100, stdin)) {&lt;br /&gt;009     sscanf(line, "%d %d", &amp;i, &amp;j);&lt;br /&gt;010     printf("%d\n", i ^ j);&lt;br /&gt;011   }&lt;br /&gt;012 &lt;br /&gt;013   return 0;&lt;br /&gt;014 }&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2271741171932159121-4796242667171587716?l=algoshare.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://algoshare.blogspot.com/feeds/4796242667171587716/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://algoshare.blogspot.com/2009/01/uva-problem-10469-sample-algorithm.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/4796242667171587716'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/4796242667171587716'/><link rel='alternate' type='text/html' href='http://algoshare.blogspot.com/2009/01/uva-problem-10469-sample-algorithm.html' title='UVa problem 10469: sample algorithm, sample code'/><author><name>Algorithm Share</name><uri>http://www.blogger.com/profile/05122107953495341186</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2271741171932159121.post-1335515586779579734</id><published>2009-01-30T03:49:00.000-08:00</published><updated>2009-01-30T03:56:28.588-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='maximum'/><category scheme='http://www.blogger.com/atom/ns#' term='problem'/><category scheme='http://www.blogger.com/atom/ns#' term='100'/><category scheme='http://www.blogger.com/atom/ns#' term='sample solution'/><category scheme='http://www.blogger.com/atom/ns#' term='bit-shift'/><category scheme='http://www.blogger.com/atom/ns#' term='right-shift'/><category scheme='http://www.blogger.com/atom/ns#' term='UVA Online Judge'/><category scheme='http://www.blogger.com/atom/ns#' term='division'/><category scheme='http://www.blogger.com/atom/ns#' term='sample code'/><category scheme='http://www.blogger.com/atom/ns#' term='3n + 1'/><category scheme='http://www.blogger.com/atom/ns#' term='left-shift'/><category scheme='http://www.blogger.com/atom/ns#' term='multiplication'/><category scheme='http://www.blogger.com/atom/ns#' term='cycle'/><title type='text'>UVa problem 100: sample code, sample algorithm</title><content type='html'>UVa problem 100 (3n + 1) is a pretty straightforward problem. There is one tricky part though. That i is not necessarily always less than j. So one needs to watch out for the case when i is greater than or equal to j.&lt;br /&gt;&lt;br /&gt;Also one, can speed things a little bit by using the bit-shift operator for division or multiplication. A division by 2 is similar to a right bit-shift by 1 bit. A multiplication by 2 is equivalent to a left bit-shift by 1 bit.&lt;br /&gt;&lt;br /&gt;That is, x / 2 is equivalent to x &gt;&gt; 1; x * 2 is equivalent to x &lt;&lt; 1.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;001 #include "stdio.h"&lt;br /&gt;002 &lt;br /&gt;003 int main() {&lt;br /&gt;004   char line[100];&lt;br /&gt;005 &lt;br /&gt;006   int   i&lt;br /&gt;007       , j&lt;br /&gt;008       , n&lt;br /&gt;009       , n0&lt;br /&gt;010       , m&lt;br /&gt;011       , cycle&lt;br /&gt;012       , max&lt;br /&gt;013       ;&lt;br /&gt;014 &lt;br /&gt;015   while (fgets(line, 100, stdin)) {&lt;br /&gt;016     sscanf(line, "%d %d", &amp;i, &amp;j);&lt;br /&gt;017 &lt;br /&gt;018     if (i &lt;= j) {&lt;br /&gt;019       for (n0 = i, max = 1; n0 &lt;= j; n0++) {&lt;br /&gt;020         n = n0;&lt;br /&gt;021         for (cycle = 1; n != 1; cycle++) {&lt;br /&gt;022           m = n &amp; 1;&lt;br /&gt;023           if (m) {&lt;br /&gt;024             m = n &lt;&lt; 1;&lt;br /&gt;025             n = m + n + 1;&lt;br /&gt;026           }&lt;br /&gt;027           else {&lt;br /&gt;028             n &gt;&gt;= 1;&lt;br /&gt;029           } &lt;br /&gt;030         }&lt;br /&gt;031         if (cycle &gt; max) {&lt;br /&gt;032           max = cycle;&lt;br /&gt;033         }&lt;br /&gt;034       }&lt;br /&gt;035     }&lt;br /&gt;036     else {&lt;br /&gt;037       for (n0 = j, max = 1; n0 &lt;= i; n0++) {&lt;br /&gt;038         n = n0;&lt;br /&gt;039         for (cycle = 1; n != 1; cycle++) {&lt;br /&gt;040           m = n &amp; 1;&lt;br /&gt;041           if (m) {&lt;br /&gt;042             m = n &lt;&lt; 1;&lt;br /&gt;043             n = m + n + 1;&lt;br /&gt;044           }&lt;br /&gt;045           else {&lt;br /&gt;046             n &gt;&gt;= 1;&lt;br /&gt;047           } &lt;br /&gt;048         }&lt;br /&gt;049         if (cycle &gt; max) {&lt;br /&gt;050           max = cycle;&lt;br /&gt;051         }&lt;br /&gt;052       }&lt;br /&gt;053     }&lt;br /&gt;054 &lt;br /&gt;055     printf("%d %d %d\n", i, j, max);&lt;br /&gt;056   }&lt;br /&gt;057 &lt;br /&gt;058   return 0;&lt;br /&gt;059 }&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2271741171932159121-1335515586779579734?l=algoshare.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://algoshare.blogspot.com/feeds/1335515586779579734/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://algoshare.blogspot.com/2009/01/uva-problem-100-sample-code.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/1335515586779579734'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/1335515586779579734'/><link rel='alternate' type='text/html' href='http://algoshare.blogspot.com/2009/01/uva-problem-100-sample-code.html' title='UVa problem 100: sample code, sample algorithm'/><author><name>Algorithm Share</name><uri>http://www.blogger.com/profile/05122107953495341186</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2271741171932159121.post-5557404985448944436</id><published>2009-01-18T02:18:00.000-08:00</published><updated>2009-01-29T01:14:39.206-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='UVA Online Judge'/><category scheme='http://www.blogger.com/atom/ns#' term='recursion'/><category scheme='http://www.blogger.com/atom/ns#' term='problem'/><category scheme='http://www.blogger.com/atom/ns#' term='F91'/><category scheme='http://www.blogger.com/atom/ns#' term='sample code'/><category scheme='http://www.blogger.com/atom/ns#' term='sample solution'/><category scheme='http://www.blogger.com/atom/ns#' term='sample algorithm'/><category scheme='http://www.blogger.com/atom/ns#' term='10696'/><title type='text'>UVa problem 10696: sample code, sample algorithm</title><content type='html'>To solve this problem, one needs to be able to discover the observation that:&lt;br /&gt;if N is greater than 100, the output is N - 10; otherwise it is always 91.&lt;br /&gt;&lt;br /&gt;One can discover this observation by running a simple simulation of the recursive F91 function:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;001 #include "stdio.h"&lt;br /&gt;002 &lt;br /&gt;003 int f91(int n) {&lt;br /&gt;004   if (n &lt;= 100) {&lt;br /&gt;005     return f91(f91(n + 11));&lt;br /&gt;006   }&lt;br /&gt;007   else {&lt;br /&gt;008     return n - 10;&lt;br /&gt;009   }&lt;br /&gt;010 }&lt;br /&gt;011 &lt;br /&gt;012 int main() {&lt;br /&gt;013   char line[100];&lt;br /&gt;014 &lt;br /&gt;015   int n;&lt;br /&gt;016 &lt;br /&gt;017   while (fgets(line, 100, stdin)) {&lt;br /&gt;018     sscanf(line, "%d", &amp;n);&lt;br /&gt;019  &lt;br /&gt;020     if (n == 0) {&lt;br /&gt;021       break;&lt;br /&gt;022     }&lt;br /&gt;023 &lt;br /&gt;024     printf("%d\n", f91(n));&lt;br /&gt;025   }&lt;br /&gt;026 &lt;br /&gt;027   return 0;&lt;br /&gt;028 }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;After discovering the pattern, one can then simplify his code like as follows:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;001 #include "stdio.h"&lt;br /&gt;002 &lt;br /&gt;003 int main() {&lt;br /&gt;004   char line[100];&lt;br /&gt;005   int   n&lt;br /&gt;006       , n1;&lt;br /&gt;007 &lt;br /&gt;008   while(fgets(line, 100, stdin)) {&lt;br /&gt;009     sscanf(line, "%d", &amp;n);&lt;br /&gt;010 &lt;br /&gt;011     if (n == 0) {&lt;br /&gt;012       break;&lt;br /&gt;013     }&lt;br /&gt;014 &lt;br /&gt;015     if (n &gt; 100) {&lt;br /&gt;016       n1 = n - 10;&lt;br /&gt;017     }&lt;br /&gt;018     else {&lt;br /&gt;019       n1 = 91;&lt;br /&gt;020     }&lt;br /&gt;021 &lt;br /&gt;022     printf("f91(%d) = %d\n", n, n1); &lt;br /&gt;023   }&lt;br /&gt;024 &lt;br /&gt;025   return 0;&lt;br /&gt;026 }&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2271741171932159121-5557404985448944436?l=algoshare.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://algoshare.blogspot.com/feeds/5557404985448944436/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://algoshare.blogspot.com/2009/01/uva-problem-10696-sample-code.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/5557404985448944436'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/5557404985448944436'/><link rel='alternate' type='text/html' href='http://algoshare.blogspot.com/2009/01/uva-problem-10696-sample-code.html' title='UVa problem 10696: sample code, sample algorithm'/><author><name>Algorithm Share</name><uri>http://www.blogger.com/profile/05122107953495341186</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2271741171932159121.post-7988736297437584537</id><published>2009-01-17T22:22:00.000-08:00</published><updated>2009-01-17T22:31:09.848-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='UVA Online Judge'/><category scheme='http://www.blogger.com/atom/ns#' term='Odd Sum'/><category scheme='http://www.blogger.com/atom/ns#' term='index'/><category scheme='http://www.blogger.com/atom/ns#' term='for-loop'/><category scheme='http://www.blogger.com/atom/ns#' term='odd numbers'/><category scheme='http://www.blogger.com/atom/ns#' term='iterator'/><category scheme='http://www.blogger.com/atom/ns#' term='iteration'/><category scheme='http://www.blogger.com/atom/ns#' term='remainder'/><category scheme='http://www.blogger.com/atom/ns#' term='even numbers'/><category scheme='http://www.blogger.com/atom/ns#' term='10783'/><category scheme='http://www.blogger.com/atom/ns#' term='mod'/><title type='text'>UVa problem 10783: sample algorithm</title><content type='html'>For UVa problem 10783 (Odd Sum), one just has to sum up all the odd numbers between two numbers, a and b. Things can get slow if for each number between a and b, one checked if that number were odd or even, like in the following code:&lt;br /&gt;&lt;br /&gt;for (i = a, sum = 0; i &lt;= b; i += 1) {&lt;br /&gt;__j = i mod 2;&lt;br /&gt;__if (j == 1) {&lt;br /&gt;____sum += i;&lt;br /&gt;__}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;To hasten the computation, we can start at an odd number in the for-loop and add 2 to the iterator index for each iteration.&lt;br /&gt;&lt;br /&gt;First we check if a is odd or even. If it is even, we increment it to make it odd. Then we go to the for-loop:&lt;br /&gt;&lt;br /&gt;for (j = a, sum = 0; j &lt;= b; j += 2) {&lt;br /&gt;__sum += j;&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2271741171932159121-7988736297437584537?l=algoshare.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://algoshare.blogspot.com/feeds/7988736297437584537/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://algoshare.blogspot.com/2009/01/uva-problem-10783-sample-algorithm.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/7988736297437584537'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/7988736297437584537'/><link rel='alternate' type='text/html' href='http://algoshare.blogspot.com/2009/01/uva-problem-10783-sample-algorithm.html' title='UVa problem 10783: sample algorithm'/><author><name>Algorithm Share</name><uri>http://www.blogger.com/profile/05122107953495341186</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2271741171932159121.post-1597837024929205809</id><published>2009-01-17T22:16:00.000-08:00</published><updated>2009-01-17T22:17:52.669-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='clue'/><category scheme='http://www.blogger.com/atom/ns#' term='Odd Sum'/><category scheme='http://www.blogger.com/atom/ns#' term='problem'/><category scheme='http://www.blogger.com/atom/ns#' term='answer'/><category scheme='http://www.blogger.com/atom/ns#' term='tip'/><category scheme='http://www.blogger.com/atom/ns#' term='sample solution'/><category scheme='http://www.blogger.com/atom/ns#' term='10783'/><category scheme='http://www.blogger.com/atom/ns#' term='UVA Online Judge'/><category scheme='http://www.blogger.com/atom/ns#' term='sample code'/><category scheme='http://www.blogger.com/atom/ns#' term='hint'/><category scheme='http://www.blogger.com/atom/ns#' term='odd numbers'/><category scheme='http://www.blogger.com/atom/ns#' term='sample algorithm'/><category scheme='http://www.blogger.com/atom/ns#' term='sum'/><title type='text'>UVa problem 10783: sample code</title><content type='html'>&lt;pre&gt;&lt;br /&gt;001 #include "stdio.h"&lt;br /&gt;002 &lt;br /&gt;003 int main() {&lt;br /&gt;004   char line[100];&lt;br /&gt;005 &lt;br /&gt;006   int   num_cases&lt;br /&gt;007       , i&lt;br /&gt;008       , j&lt;br /&gt;009       , k&lt;br /&gt;010       , a&lt;br /&gt;011       , b&lt;br /&gt;012       , sum&lt;br /&gt;013       ;&lt;br /&gt;014 &lt;br /&gt;015   fgets(line, 100, stdin);&lt;br /&gt;016   sscanf(line, "%d", &amp;num_cases);&lt;br /&gt;017 &lt;br /&gt;018   for (i = 1; i &lt;= num_cases; i += 1) {&lt;br /&gt;019     fgets(line, 100, stdin);&lt;br /&gt;020     sscanf(line, "%d", &amp;a);&lt;br /&gt;021 &lt;br /&gt;022     fgets(line, 100, stdin);&lt;br /&gt;023     sscanf(line, "%d", &amp;b);&lt;br /&gt;024 &lt;br /&gt;025     k = a &amp; 1;&lt;br /&gt;026     if (k == 0) {&lt;br /&gt;027       a += 1;&lt;br /&gt;028     }&lt;br /&gt;029 &lt;br /&gt;030     for (j = a, sum = 0; j &lt;= b; j += 2) {&lt;br /&gt;031       sum += j;&lt;br /&gt;032     }&lt;br /&gt;033 &lt;br /&gt;034     printf("Case %d: %d\n", i, sum);&lt;br /&gt;035   }&lt;br /&gt;036 &lt;br /&gt;037   return 0;&lt;br /&gt;038 }&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2271741171932159121-1597837024929205809?l=algoshare.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://algoshare.blogspot.com/feeds/1597837024929205809/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://algoshare.blogspot.com/2009/01/uva-problem-10783-sample-code.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/1597837024929205809'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/1597837024929205809'/><link rel='alternate' type='text/html' href='http://algoshare.blogspot.com/2009/01/uva-problem-10783-sample-code.html' title='UVa problem 10783: sample code'/><author><name>Algorithm Share</name><uri>http://www.blogger.com/profile/05122107953495341186</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2271741171932159121.post-1732740724643406075</id><published>2009-01-17T03:48:00.000-08:00</published><updated>2009-01-17T04:08:33.888-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='UVA Online Judge'/><category scheme='http://www.blogger.com/atom/ns#' term='intersection'/><category scheme='http://www.blogger.com/atom/ns#' term='embedded chess boards'/><category scheme='http://www.blogger.com/atom/ns#' term='analysis'/><category scheme='http://www.blogger.com/atom/ns#' term='vertical'/><category scheme='http://www.blogger.com/atom/ns#' term='passing lane'/><category scheme='http://www.blogger.com/atom/ns#' term='horizontal'/><category scheme='http://www.blogger.com/atom/ns#' term='11231'/><category scheme='http://www.blogger.com/atom/ns#' term='chess'/><category scheme='http://www.blogger.com/atom/ns#' term='Black and white painting'/><title type='text'>UVa problem 11231: sample algorithm</title><content type='html'>&lt;meta equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;meta name="ProgId" content="Word.Document"&gt;&lt;meta name="Generator" content="Microsoft Word 12"&gt;&lt;meta name="Originator" content="Microsoft Word 12"&gt;&lt;link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CJIMMYY%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml"&gt;&lt;link rel="themeData" href="file:///C:%5CDOCUME%7E1%5CJIMMYY%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx"&gt;&lt;link rel="colorSchemeMapping" href="file:///C:%5CDOCUME%7E1%5CJIMMYY%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml"&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:trackmoves/&gt;   &lt;w:trackformatting/&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:donotpromoteqf/&gt;   &lt;w:lidthemeother&gt;EN-US&lt;/w:LidThemeOther&gt;   &lt;w:lidthemeasian&gt;X-NONE&lt;/w:LidThemeAsian&gt;   &lt;w:lidthemecomplexscript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;    &lt;w:splitpgbreakandparamark/&gt;    &lt;w:dontvertaligncellwithsp/&gt;    &lt;w:dontbreakconstrainedforcedtables/&gt;    &lt;w:dontvertalignintxbx/&gt;    &lt;w:word11kerningpairs/&gt;    &lt;w:cachedcolbalance/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;   &lt;m:mathpr&gt;    &lt;m:mathfont val="Cambria Math"&gt;    &lt;m:brkbin val="before"&gt;    &lt;m:brkbinsub val="--"&gt;    &lt;m:smallfrac val="off"&gt;    &lt;m:dispdef/&gt;    &lt;m:lmargin val="0"&gt;    &lt;m:rmargin val="0"&gt;    &lt;m:defjc val="centerGroup"&gt;    &lt;m:wrapindent val="1440"&gt;    &lt;m:intlim val="subSup"&gt;    &lt;m:narylim val="undOvr"&gt;   &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" defunhidewhenused="true" defsemihidden="true" defqformat="false" defpriority="99" latentstylecount="267"&gt;   &lt;w:lsdexception locked="false" priority="0" semihidden="false" unhidewhenused="false" qformat="true" name="Normal"&gt;   &lt;w:lsdexception locked="false" priority="9" semihidden="false" unhidewhenused="false" qformat="true" name="heading 1"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 2"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 3"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 4"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 5"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 6"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 7"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 8"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 9"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 1"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 2"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 3"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 4"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 5"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 6"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 7"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 8"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 9"&gt;   &lt;w:lsdexception locked="false" priority="35" qformat="true" name="caption"&gt;   &lt;w:lsdexception locked="false" priority="10" semihidden="false" unhidewhenused="false" qformat="true" name="Title"&gt;   &lt;w:lsdexception locked="false" priority="1" name="Default Paragraph Font"&gt;   &lt;w:lsdexception locked="false" priority="11" semihidden="false" unhidewhenused="false" qformat="true" name="Subtitle"&gt;   &lt;w:lsdexception locked="false" priority="22" semihidden="false" unhidewhenused="false" qformat="true" name="Strong"&gt;   &lt;w:lsdexception locked="false" priority="20" semihidden="false" unhidewhenused="false" qformat="true" name="Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="59" semihidden="false" unhidewhenused="false" name="Table Grid"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Placeholder Text"&gt;   &lt;w:lsdexception locked="false" priority="1" semihidden="false" unhidewhenused="false" qformat="true" name="No Spacing"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Revision"&gt;   &lt;w:lsdexception locked="false" priority="34" semihidden="false" unhidewhenused="false" qformat="true" name="List Paragraph"&gt;   &lt;w:lsdexception locked="false" priority="29" semihidden="false" unhidewhenused="false" qformat="true" name="Quote"&gt;   &lt;w:lsdexception locked="false" priority="30" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Quote"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="19" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="21" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="31" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Reference"&gt;   &lt;w:lsdexception locked="false" priority="32" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Reference"&gt;   &lt;w:lsdexception locked="false" priority="33" semihidden="false" unhidewhenused="false" qformat="true" name="Book Title"&gt;   &lt;w:lsdexception locked="false" priority="37" name="Bibliography"&gt;   &lt;w:lsdexception locked="false" priority="39" qformat="true" name="TOC Heading"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:1; 	mso-generic-font-family:roman; 	mso-font-format:other; 	mso-font-pitch:variable; 	mso-font-signature:0 0 0 0 0 0;} @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1073750139 0 0 159 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin-top:0in; 	margin-right:0in; 	margin-bottom:10.0pt; 	margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} p.MsoNoSpacing, li.MsoNoSpacing, div.MsoNoSpacing 	{mso-style-priority:1; 	mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoPapDefault 	{mso-style-type:export-only; 	margin-bottom:10.0pt; 	line-height:115%;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.0in 1.0in 1.0in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-qformat:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin-top:0in; 	mso-para-margin-right:0in; 	mso-para-margin-bottom:10.0pt; 	mso-para-margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;p class="MsoNoSpacing"&gt;To solve UVa problem 11231 (Black and white painting), one has to distinguish between two cases: when the top left corner (first_box) is white, or black. After some analyses, one is able to find a way to determine if the first_box is white or black based on the given n, m and c. Figure 1 summarizes this.&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_2PJwbgod-iA/SXHGFsasYOI/AAAAAAAAADU/-if2UMiq4kc/s1600-h/pic1.JPG"&gt;&lt;img style="cursor: pointer; width: 372px; height: 222px;" src="http://2.bp.blogspot.com/_2PJwbgod-iA/SXHGFsasYOI/AAAAAAAAADU/-if2UMiq4kc/s400/pic1.JPG" alt="" id="BLOGGER_PHOTO_ID_5292228838261809378" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;meta equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;meta name="ProgId" content="Word.Document"&gt;&lt;meta name="Generator" content="Microsoft Word 12"&gt;&lt;meta name="Originator" content="Microsoft Word 12"&gt;&lt;link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CJIMMYY%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml"&gt;&lt;link rel="themeData" href="file:///C:%5CDOCUME%7E1%5CJIMMYY%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx"&gt;&lt;link rel="colorSchemeMapping" href="file:///C:%5CDOCUME%7E1%5CJIMMYY%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml"&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:trackmoves/&gt;   &lt;w:trackformatting/&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:donotpromoteqf/&gt;   &lt;w:lidthemeother&gt;EN-US&lt;/w:LidThemeOther&gt;   &lt;w:lidthemeasian&gt;X-NONE&lt;/w:LidThemeAsian&gt;   &lt;w:lidthemecomplexscript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;    &lt;w:splitpgbreakandparamark/&gt;    &lt;w:dontvertaligncellwithsp/&gt;    &lt;w:dontbreakconstrainedforcedtables/&gt;    &lt;w:dontvertalignintxbx/&gt;    &lt;w:word11kerningpairs/&gt;    &lt;w:cachedcolbalance/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;   &lt;m:mathpr&gt;    &lt;m:mathfont val="Cambria Math"&gt;    &lt;m:brkbin val="before"&gt;    &lt;m:brkbinsub val="--"&gt;    &lt;m:smallfrac val="off"&gt;    &lt;m:dispdef/&gt;    &lt;m:lmargin val="0"&gt;    &lt;m:rmargin val="0"&gt;    &lt;m:defjc val="centerGroup"&gt;    &lt;m:wrapindent val="1440"&gt;    &lt;m:intlim val="subSup"&gt;    &lt;m:narylim val="undOvr"&gt;   &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" defunhidewhenused="true" defsemihidden="true" defqformat="false" defpriority="99" latentstylecount="267"&gt;   &lt;w:lsdexception locked="false" priority="0" semihidden="false" unhidewhenused="false" qformat="true" name="Normal"&gt;   &lt;w:lsdexception locked="false" priority="9" semihidden="false" unhidewhenused="false" qformat="true" name="heading 1"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 2"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 3"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 4"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 5"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 6"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 7"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 8"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 9"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 1"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 2"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 3"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 4"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 5"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 6"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 7"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 8"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 9"&gt;   &lt;w:lsdexception locked="false" priority="35" qformat="true" name="caption"&gt;   &lt;w:lsdexception locked="false" priority="10" semihidden="false" unhidewhenused="false" qformat="true" name="Title"&gt;   &lt;w:lsdexception locked="false" priority="1" name="Default Paragraph Font"&gt;   &lt;w:lsdexception locked="false" priority="11" semihidden="false" unhidewhenused="false" qformat="true" name="Subtitle"&gt;   &lt;w:lsdexception locked="false" priority="22" semihidden="false" unhidewhenused="false" qformat="true" name="Strong"&gt;   &lt;w:lsdexception locked="false" priority="20" semihidden="false" unhidewhenused="false" qformat="true" name="Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="59" semihidden="false" unhidewhenused="false" name="Table Grid"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Placeholder Text"&gt;   &lt;w:lsdexception locked="false" priority="1" semihidden="false" unhidewhenused="false" qformat="true" name="No Spacing"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Revision"&gt;   &lt;w:lsdexception locked="false" priority="34" semihidden="false" unhidewhenused="false" qformat="true" name="List Paragraph"&gt;   &lt;w:lsdexception locked="false" priority="29" semihidden="false" unhidewhenused="false" qformat="true" name="Quote"&gt;   &lt;w:lsdexception locked="false" priority="30" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Quote"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="19" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="21" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="31" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Reference"&gt;   &lt;w:lsdexception locked="false" priority="32" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Reference"&gt;   &lt;w:lsdexception locked="false" priority="33" semihidden="false" unhidewhenused="false" qformat="true" name="Book Title"&gt;   &lt;w:lsdexception locked="false" priority="37" name="Bibliography"&gt;   &lt;w:lsdexception locked="false" priority="39" qformat="true" name="TOC Heading"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:1; 	mso-generic-font-family:roman; 	mso-font-format:other; 	mso-font-pitch:variable; 	mso-font-signature:0 0 0 0 0 0;} @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1073750139 0 0 159 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin-top:0in; 	margin-right:0in; 	margin-bottom:10.0pt; 	margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} p.MsoNoSpacing, li.MsoNoSpacing, div.MsoNoSpacing 	{mso-style-priority:1; 	mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoPapDefault 	{mso-style-type:export-only; 	margin-bottom:10.0pt; 	line-height:115%;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.0in 1.0in 1.0in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-qformat:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin-top:0in; 	mso-para-margin-right:0in; 	mso-para-margin-bottom:10.0pt; 	mso-para-margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;p class="MsoNoSpacing"&gt;Figure 1. Summary for determining if the top left corner is white or black given n, m and c.&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;In Figure 1, if n and m are of the same type, for example, both even or both odd, then the color of the bottom right corner (last_box) will be the same as the first_box. Otherwise, they will have opposite colors.&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;First, we tackle the case when the first_box is white (case_white). For case_white, there are two cases. Let us name them case_white1 and case_white2.&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;For case_white1, we take a look at the chess boards embedded within the painting. This is shown in Figure 2.&lt;/p&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_2PJwbgod-iA/SXHGCU4j2vI/AAAAAAAAADM/3d1vOXRTnFo/s1600-h/pic2.JPG"&gt;&lt;img style="cursor: pointer; width: 400px; height: 381px;" src="http://4.bp.blogspot.com/_2PJwbgod-iA/SXHGCU4j2vI/AAAAAAAAADM/3d1vOXRTnFo/s400/pic2.JPG" alt="" id="BLOGGER_PHOTO_ID_5292228780405021426" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;meta equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;meta name="ProgId" content="Word.Document"&gt;&lt;meta name="Generator" content="Microsoft Word 12"&gt;&lt;meta name="Originator" content="Microsoft Word 12"&gt;&lt;link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CJIMMYY%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml"&gt;&lt;link rel="themeData" href="file:///C:%5CDOCUME%7E1%5CJIMMYY%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx"&gt;&lt;link rel="colorSchemeMapping" href="file:///C:%5CDOCUME%7E1%5CJIMMYY%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml"&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:trackmoves/&gt;   &lt;w:trackformatting/&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:donotpromoteqf/&gt;   &lt;w:lidthemeother&gt;EN-US&lt;/w:LidThemeOther&gt;   &lt;w:lidthemeasian&gt;X-NONE&lt;/w:LidThemeAsian&gt;   &lt;w:lidthemecomplexscript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;    &lt;w:splitpgbreakandparamark/&gt;    &lt;w:dontvertaligncellwithsp/&gt;    &lt;w:dontbreakconstrainedforcedtables/&gt;    &lt;w:dontvertalignintxbx/&gt;    &lt;w:word11kerningpairs/&gt;    &lt;w:cachedcolbalance/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;   &lt;m:mathpr&gt;    &lt;m:mathfont val="Cambria Math"&gt;    &lt;m:brkbin val="before"&gt;    &lt;m:brkbinsub val="--"&gt;    &lt;m:smallfrac val="off"&gt;    &lt;m:dispdef/&gt;    &lt;m:lmargin val="0"&gt;    &lt;m:rmargin val="0"&gt;    &lt;m:defjc val="centerGroup"&gt;    &lt;m:wrapindent val="1440"&gt;    &lt;m:intlim val="subSup"&gt;    &lt;m:narylim val="undOvr"&gt;   &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" defunhidewhenused="true" defsemihidden="true" defqformat="false" defpriority="99" latentstylecount="267"&gt;   &lt;w:lsdexception locked="false" priority="0" semihidden="false" unhidewhenused="false" qformat="true" name="Normal"&gt;   &lt;w:lsdexception locked="false" priority="9" semihidden="false" unhidewhenused="false" qformat="true" name="heading 1"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 2"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 3"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 4"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 5"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 6"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 7"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 8"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 9"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 1"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 2"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 3"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 4"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 5"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 6"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 7"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 8"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 9"&gt;   &lt;w:lsdexception locked="false" priority="35" qformat="true" name="caption"&gt;   &lt;w:lsdexception locked="false" priority="10" semihidden="false" unhidewhenused="false" qformat="true" name="Title"&gt;   &lt;w:lsdexception locked="false" priority="1" name="Default Paragraph Font"&gt;   &lt;w:lsdexception locked="false" priority="11" semihidden="false" unhidewhenused="false" qformat="true" name="Subtitle"&gt;   &lt;w:lsdexception locked="false" priority="22" semihidden="false" unhidewhenused="false" qformat="true" name="Strong"&gt;   &lt;w:lsdexception locked="false" priority="20" semihidden="false" unhidewhenused="false" qformat="true" name="Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="59" semihidden="false" unhidewhenused="false" name="Table Grid"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Placeholder Text"&gt;   &lt;w:lsdexception locked="false" priority="1" semihidden="false" unhidewhenused="false" qformat="true" name="No Spacing"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Revision"&gt;   &lt;w:lsdexception locked="false" priority="34" semihidden="false" unhidewhenused="false" qformat="true" name="List Paragraph"&gt;   &lt;w:lsdexception locked="false" priority="29" semihidden="false" unhidewhenused="false" qformat="true" name="Quote"&gt;   &lt;w:lsdexception locked="false" priority="30" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Quote"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="19" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="21" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="31" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Reference"&gt;   &lt;w:lsdexception locked="false" priority="32" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Reference"&gt;   &lt;w:lsdexception locked="false" priority="33" semihidden="false" unhidewhenused="false" qformat="true" name="Book Title"&gt;   &lt;w:lsdexception locked="false" priority="37" name="Bibliography"&gt;   &lt;w:lsdexception locked="false" priority="39" qformat="true" name="TOC Heading"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:1; 	mso-generic-font-family:roman; 	mso-font-format:other; 	mso-font-pitch:variable; 	mso-font-signature:0 0 0 0 0 0;} @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1073750139 0 0 159 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin-top:0in; 	margin-right:0in; 	margin-bottom:10.0pt; 	margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} p.MsoNoSpacing, li.MsoNoSpacing, div.MsoNoSpacing 	{mso-style-priority:1; 	mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoPapDefault 	{mso-style-type:export-only; 	margin-bottom:10.0pt; 	line-height:115%;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.0in 1.0in 1.0in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-qformat:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin-top:0in; 	mso-para-margin-right:0in; 	mso-para-margin-bottom:10.0pt; 	mso-para-margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;p class="MsoNoSpacing"&gt;Figure 2. Chess boards embedded in the painting for case_white_1.&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;In Figure 2, passing lanes, both horizontal and vertical are shown. Only 4 passing lanes are shown to avoid clutter. A chess board is defined for each intersection between a horizontal passing lane and a vertical passing lane.&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;We define a chess board as having four coordinates: h1, h2, v1, v2. h1 stands for the lower-numbered row of the board, h2 stands for the higher-numbered row, v1 stands for the lower-numbered column and v2 stands for the higher-numbered column. A chess board will be designated (h1, h2, v1, v2) for brevity.&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;In Figure 2, then, there are 4 embedded chess boards as identified when a horizontal lane intersects a vertical lane:&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;(1, 8, 1, 8)&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;(1, 8, 3, 10)&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;(3, 10, 1, 8)&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;(3, 10, 3, 10)&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;To compute the number of embedded chess boards in case_white1, we need to obtain the total number of boards in each vertical passing lane. Let us call this number x. We also need to obtain the total number of boards in each horizontal passing lane, calling this number y. The product of x and y will give us the total number of boards for case_white1. Let us call this product, z.&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;By observing the patterns in case_white1, we arrive at a formula given by Equation 1.&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;[Equation 1]&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;x = (n - 6) / 2&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;y = (m - 6) / 2&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;z = x * y&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;Next, we tackle case_white2. Figure 3 shows the embedded boards for case_white2.&lt;/p&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_2PJwbgod-iA/SXHF-zhdM6I/AAAAAAAAADE/wtJ88ADlnxg/s1600-h/pic3.JPG"&gt;&lt;img style="cursor: pointer; width: 400px; height: 365px;" src="http://4.bp.blogspot.com/_2PJwbgod-iA/SXHF-zhdM6I/AAAAAAAAADE/wtJ88ADlnxg/s400/pic3.JPG" alt="" id="BLOGGER_PHOTO_ID_5292228719910138786" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;meta equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;meta name="ProgId" content="Word.Document"&gt;&lt;meta name="Generator" content="Microsoft Word 12"&gt;&lt;meta name="Originator" content="Microsoft Word 12"&gt;&lt;link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CJIMMYY%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml"&gt;&lt;link rel="themeData" href="file:///C:%5CDOCUME%7E1%5CJIMMYY%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx"&gt;&lt;link rel="colorSchemeMapping" href="file:///C:%5CDOCUME%7E1%5CJIMMYY%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml"&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:trackmoves/&gt;   &lt;w:trackformatting/&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:donotpromoteqf/&gt;   &lt;w:lidthemeother&gt;EN-US&lt;/w:LidThemeOther&gt;   &lt;w:lidthemeasian&gt;X-NONE&lt;/w:LidThemeAsian&gt;   &lt;w:lidthemecomplexscript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;    &lt;w:splitpgbreakandparamark/&gt;    &lt;w:dontvertaligncellwithsp/&gt;    &lt;w:dontbreakconstrainedforcedtables/&gt;    &lt;w:dontvertalignintxbx/&gt;    &lt;w:word11kerningpairs/&gt;    &lt;w:cachedcolbalance/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;   &lt;m:mathpr&gt;    &lt;m:mathfont val="Cambria Math"&gt;    &lt;m:brkbin val="before"&gt;    &lt;m:brkbinsub val="--"&gt;    &lt;m:smallfrac val="off"&gt;    &lt;m:dispdef/&gt;    &lt;m:lmargin val="0"&gt;    &lt;m:rmargin val="0"&gt;    &lt;m:defjc val="centerGroup"&gt;    &lt;m:wrapindent val="1440"&gt;    &lt;m:intlim val="subSup"&gt;    &lt;m:narylim val="undOvr"&gt;   &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" defunhidewhenused="true" defsemihidden="true" defqformat="false" defpriority="99" latentstylecount="267"&gt;   &lt;w:lsdexception locked="false" priority="0" semihidden="false" unhidewhenused="false" qformat="true" name="Normal"&gt;   &lt;w:lsdexception locked="false" priority="9" semihidden="false" unhidewhenused="false" qformat="true" name="heading 1"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 2"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 3"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 4"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 5"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 6"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 7"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 8"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 9"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 1"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 2"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 3"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 4"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 5"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 6"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 7"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 8"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 9"&gt;   &lt;w:lsdexception locked="false" priority="35" qformat="true" name="caption"&gt;   &lt;w:lsdexception locked="false" priority="10" semihidden="false" unhidewhenused="false" qformat="true" name="Title"&gt;   &lt;w:lsdexception locked="false" priority="1" name="Default Paragraph Font"&gt;   &lt;w:lsdexception locked="false" priority="11" semihidden="false" unhidewhenused="false" qformat="true" name="Subtitle"&gt;   &lt;w:lsdexception locked="false" priority="22" semihidden="false" unhidewhenused="false" qformat="true" name="Strong"&gt;   &lt;w:lsdexception locked="false" priority="20" semihidden="false" unhidewhenused="false" qformat="true" name="Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="59" semihidden="false" unhidewhenused="false" name="Table Grid"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Placeholder Text"&gt;   &lt;w:lsdexception locked="false" priority="1" semihidden="false" unhidewhenused="false" qformat="true" name="No Spacing"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Revision"&gt;   &lt;w:lsdexception locked="false" priority="34" semihidden="false" unhidewhenused="false" qformat="true" name="List Paragraph"&gt;   &lt;w:lsdexception locked="false" priority="29" semihidden="false" unhidewhenused="false" qformat="true" name="Quote"&gt;   &lt;w:lsdexception locked="false" priority="30" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Quote"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="19" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="21" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="31" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Reference"&gt;   &lt;w:lsdexception locked="false" priority="32" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Reference"&gt;   &lt;w:lsdexception locked="false" priority="33" semihidden="false" unhidewhenused="false" qformat="true" name="Book Title"&gt;   &lt;w:lsdexception locked="false" priority="37" name="Bibliography"&gt;   &lt;w:lsdexception locked="false" priority="39" qformat="true" name="TOC Heading"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:1; 	mso-generic-font-family:roman; 	mso-font-format:other; 	mso-font-pitch:variable; 	mso-font-signature:0 0 0 0 0 0;} @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1073750139 0 0 159 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin-top:0in; 	margin-right:0in; 	margin-bottom:10.0pt; 	margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} p.MsoNoSpacing, li.MsoNoSpacing, div.MsoNoSpacing 	{mso-style-priority:1; 	mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoPapDefault 	{mso-style-type:export-only; 	margin-bottom:10.0pt; 	line-height:115%;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.0in 1.0in 1.0in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-qformat:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin-top:0in; 	mso-para-margin-right:0in; 	mso-para-margin-bottom:10.0pt; 	mso-para-margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;p class="MsoNoSpacing"&gt;Figure 3. Chess boards embedded in the painting for case_white_2.&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;In Figure 3, the embedded boards have the following coordinates:&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;(2, 9, 2, 9)&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;(2, 9, 4, 11)&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;(4, 11, 2, 9)&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;(4, 11, 4, 11)&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;Taking the numbers of boards in the vertical lanes to be q, and the number of boards in the horizontal lanes to be r, we arrive at Equation 2, where s is the total number of boards for case_white2&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;[Equation 2]&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;q = (n - 7) / 2&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;r = (m - 7) / 2&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;s = q * r&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;span style="line-height: 115%;font-family:&amp;quot;;font-size:100%;"  &gt;Next, we take on case_black. case_black like case_white offers two cases: case_black1 and case_black2. Figure 4 shows some of the boards in case_black1.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_2PJwbgod-iA/SXHF791GU-I/AAAAAAAAAC8/scsdJ8p8MTY/s1600-h/pic4.JPG"&gt;&lt;img style="cursor: pointer; width: 400px; height: 398px;" src="http://1.bp.blogspot.com/_2PJwbgod-iA/SXHF791GU-I/AAAAAAAAAC8/scsdJ8p8MTY/s400/pic4.JPG" alt="" id="BLOGGER_PHOTO_ID_5292228671137272802" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;meta equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;meta name="ProgId" content="Word.Document"&gt;&lt;meta name="Generator" content="Microsoft Word 12"&gt;&lt;meta name="Originator" content="Microsoft Word 12"&gt;&lt;link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CJIMMYY%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml"&gt;&lt;link rel="themeData" href="file:///C:%5CDOCUME%7E1%5CJIMMYY%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx"&gt;&lt;link rel="colorSchemeMapping" href="file:///C:%5CDOCUME%7E1%5CJIMMYY%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml"&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:trackmoves/&gt;   &lt;w:trackformatting/&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:donotpromoteqf/&gt;   &lt;w:lidthemeother&gt;EN-US&lt;/w:LidThemeOther&gt;   &lt;w:lidthemeasian&gt;X-NONE&lt;/w:LidThemeAsian&gt;   &lt;w:lidthemecomplexscript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;    &lt;w:splitpgbreakandparamark/&gt;    &lt;w:dontvertaligncellwithsp/&gt;    &lt;w:dontbreakconstrainedforcedtables/&gt;    &lt;w:dontvertalignintxbx/&gt;    &lt;w:word11kerningpairs/&gt;    &lt;w:cachedcolbalance/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;   &lt;m:mathpr&gt;    &lt;m:mathfont val="Cambria Math"&gt;    &lt;m:brkbin val="before"&gt;    &lt;m:brkbinsub val="--"&gt;    &lt;m:smallfrac val="off"&gt;    &lt;m:dispdef/&gt;    &lt;m:lmargin val="0"&gt;    &lt;m:rmargin val="0"&gt;    &lt;m:defjc val="centerGroup"&gt;    &lt;m:wrapindent val="1440"&gt;    &lt;m:intlim val="subSup"&gt;    &lt;m:narylim val="undOvr"&gt;   &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" defunhidewhenused="true" defsemihidden="true" defqformat="false" defpriority="99" latentstylecount="267"&gt;   &lt;w:lsdexception locked="false" priority="0" semihidden="false" unhidewhenused="false" qformat="true" name="Normal"&gt;   &lt;w:lsdexception locked="false" priority="9" semihidden="false" unhidewhenused="false" qformat="true" name="heading 1"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 2"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 3"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 4"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 5"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 6"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 7"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 8"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 9"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 1"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 2"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 3"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 4"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 5"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 6"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 7"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 8"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 9"&gt;   &lt;w:lsdexception locked="false" priority="35" qformat="true" name="caption"&gt;   &lt;w:lsdexception locked="false" priority="10" semihidden="false" unhidewhenused="false" qformat="true" name="Title"&gt;   &lt;w:lsdexception locked="false" priority="1" name="Default Paragraph Font"&gt;   &lt;w:lsdexception locked="false" priority="11" semihidden="false" unhidewhenused="false" qformat="true" name="Subtitle"&gt;   &lt;w:lsdexception locked="false" priority="22" semihidden="false" unhidewhenused="false" qformat="true" name="Strong"&gt;   &lt;w:lsdexception locked="false" priority="20" semihidden="false" unhidewhenused="false" qformat="true" name="Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="59" semihidden="false" unhidewhenused="false" name="Table Grid"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Placeholder Text"&gt;   &lt;w:lsdexception locked="false" priority="1" semihidden="false" unhidewhenused="false" qformat="true" name="No Spacing"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Revision"&gt;   &lt;w:lsdexception locked="false" priority="34" semihidden="false" unhidewhenused="false" qformat="true" name="List Paragraph"&gt;   &lt;w:lsdexception locked="false" priority="29" semihidden="false" unhidewhenused="false" qformat="true" name="Quote"&gt;   &lt;w:lsdexception locked="false" priority="30" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Quote"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="19" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="21" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="31" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Reference"&gt;   &lt;w:lsdexception locked="false" priority="32" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Reference"&gt;   &lt;w:lsdexception locked="false" priority="33" semihidden="false" unhidewhenused="false" qformat="true" name="Book Title"&gt;   &lt;w:lsdexception locked="false" priority="37" name="Bibliography"&gt;   &lt;w:lsdexception locked="false" priority="39" qformat="true" name="TOC Heading"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:1; 	mso-generic-font-family:roman; 	mso-font-format:other; 	mso-font-pitch:variable; 	mso-font-signature:0 0 0 0 0 0;} @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1073750139 0 0 159 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin-top:0in; 	margin-right:0in; 	margin-bottom:10.0pt; 	margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} p.MsoNoSpacing, li.MsoNoSpacing, div.MsoNoSpacing 	{mso-style-priority:1; 	mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoPapDefault 	{mso-style-type:export-only; 	margin-bottom:10.0pt; 	line-height:115%;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.0in 1.0in 1.0in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-qformat:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin-top:0in; 	mso-para-margin-right:0in; 	mso-para-margin-bottom:10.0pt; 	mso-para-margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;p class="MsoNoSpacing"&gt;Figure 4. Chess boards embedded in case_black_1.&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;In Figure 4, the boards have the following coordinates:&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;(2, 9, 1, 8)&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;(2, 9, 3, 10)&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;(4, 11, 1, 8)&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;(4, 11, 3, 10)&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;We also arrive at Equation 3, using the same analogy for the variable names as in Equation 1.&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;[Equation 3]&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;x = (n - 7) / 2&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;y = (m - 6) / 2&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;z = x * y&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;    &lt;p class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;Figure 5 shows case_black_2.&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_2PJwbgod-iA/SXHFw7CCngI/AAAAAAAAAC0/Ug2hujtSduQ/s1600-h/pic5.JPG"&gt;&lt;img style="cursor: pointer; width: 400px; height: 399px;" src="http://1.bp.blogspot.com/_2PJwbgod-iA/SXHFw7CCngI/AAAAAAAAAC0/Ug2hujtSduQ/s400/pic5.JPG" alt="" id="BLOGGER_PHOTO_ID_5292228481407688194" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;meta equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;meta name="ProgId" content="Word.Document"&gt;&lt;meta name="Generator" content="Microsoft Word 12"&gt;&lt;meta name="Originator" content="Microsoft Word 12"&gt;&lt;link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CJIMMYY%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml"&gt;&lt;link rel="themeData" href="file:///C:%5CDOCUME%7E1%5CJIMMYY%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx"&gt;&lt;link rel="colorSchemeMapping" href="file:///C:%5CDOCUME%7E1%5CJIMMYY%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml"&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:trackmoves/&gt;   &lt;w:trackformatting/&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:donotpromoteqf/&gt;   &lt;w:lidthemeother&gt;EN-US&lt;/w:LidThemeOther&gt;   &lt;w:lidthemeasian&gt;X-NONE&lt;/w:LidThemeAsian&gt;   &lt;w:lidthemecomplexscript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;    &lt;w:splitpgbreakandparamark/&gt;    &lt;w:dontvertaligncellwithsp/&gt;    &lt;w:dontbreakconstrainedforcedtables/&gt;    &lt;w:dontvertalignintxbx/&gt;    &lt;w:word11kerningpairs/&gt;    &lt;w:cachedcolbalance/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;   &lt;m:mathpr&gt;    &lt;m:mathfont val="Cambria Math"&gt;    &lt;m:brkbin val="before"&gt;    &lt;m:brkbinsub val="--"&gt;    &lt;m:smallfrac val="off"&gt;    &lt;m:dispdef/&gt;    &lt;m:lmargin val="0"&gt;    &lt;m:rmargin val="0"&gt;    &lt;m:defjc val="centerGroup"&gt;    &lt;m:wrapindent val="1440"&gt;    &lt;m:intlim val="subSup"&gt;    &lt;m:narylim val="undOvr"&gt;   &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" defunhidewhenused="true" defsemihidden="true" defqformat="false" defpriority="99" latentstylecount="267"&gt;   &lt;w:lsdexception locked="false" priority="0" semihidden="false" unhidewhenused="false" qformat="true" name="Normal"&gt;   &lt;w:lsdexception locked="false" priority="9" semihidden="false" unhidewhenused="false" qformat="true" name="heading 1"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 2"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 3"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 4"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 5"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 6"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 7"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 8"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 9"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 1"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 2"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 3"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 4"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 5"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 6"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 7"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 8"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 9"&gt;   &lt;w:lsdexception locked="false" priority="35" qformat="true" name="caption"&gt;   &lt;w:lsdexception locked="false" priority="10" semihidden="false" unhidewhenused="false" qformat="true" name="Title"&gt;   &lt;w:lsdexception locked="false" priority="1" name="Default Paragraph Font"&gt;   &lt;w:lsdexception locked="false" priority="11" semihidden="false" unhidewhenused="false" qformat="true" name="Subtitle"&gt;   &lt;w:lsdexception locked="false" priority="22" semihidden="false" unhidewhenused="false" qformat="true" name="Strong"&gt;   &lt;w:lsdexception locked="false" priority="20" semihidden="false" unhidewhenused="false" qformat="true" name="Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="59" semihidden="false" unhidewhenused="false" name="Table Grid"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Placeholder Text"&gt;   &lt;w:lsdexception locked="false" priority="1" semihidden="false" unhidewhenused="false" qformat="true" name="No Spacing"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Revision"&gt;   &lt;w:lsdexception locked="false" priority="34" semihidden="false" unhidewhenused="false" qformat="true" name="List Paragraph"&gt;   &lt;w:lsdexception locked="false" priority="29" semihidden="false" unhidewhenused="false" qformat="true" name="Quote"&gt;   &lt;w:lsdexception locked="false" priority="30" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Quote"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="19" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="21" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="31" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Reference"&gt;   &lt;w:lsdexception locked="false" priority="32" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Reference"&gt;   &lt;w:lsdexception locked="false" priority="33" semihidden="false" unhidewhenused="false" qformat="true" name="Book Title"&gt;   &lt;w:lsdexception locked="false" priority="37" name="Bibliography"&gt;   &lt;w:lsdexception locked="false" priority="39" qformat="true" name="TOC Heading"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:1; 	mso-generic-font-family:roman; 	mso-font-format:other; 	mso-font-pitch:variable; 	mso-font-signature:0 0 0 0 0 0;} @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1073750139 0 0 159 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin-top:0in; 	margin-right:0in; 	margin-bottom:10.0pt; 	margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} p.MsoNoSpacing, li.MsoNoSpacing, div.MsoNoSpacing 	{mso-style-priority:1; 	mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoPapDefault 	{mso-style-type:export-only; 	margin-bottom:10.0pt; 	line-height:115%;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.0in 1.0in 1.0in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-qformat:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin-top:0in; 	mso-para-margin-right:0in; 	mso-para-margin-bottom:10.0pt; 	mso-para-margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;p class="MsoNoSpacing"&gt;Figure 5, chess boards embedded in case_black2.&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;In Figure 5, the following boards are defined:&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;(1, 8, 2, 9)&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;(1, 8, 4, 11)&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;(3, 10, 2, 9)&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;(3, 10, 4, 11)&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;Equation 4 is also derived using the same terminologies as used in Equation 2.&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;[Equation 4]&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;q = (n - 6) / 2&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;r = (m - 7) / 2&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;s = q * r&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;span style="line-height: 115%;font-family:&amp;quot;;font-size:100%;"  &gt;The total number of embedded chess boards for either case, case_white or case_black, is the sum of z and s.&lt;/span&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2271741171932159121-1732740724643406075?l=algoshare.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://algoshare.blogspot.com/feeds/1732740724643406075/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://algoshare.blogspot.com/2009/01/uva-problem-11231-sample-algorithm.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/1732740724643406075'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/1732740724643406075'/><link rel='alternate' type='text/html' href='http://algoshare.blogspot.com/2009/01/uva-problem-11231-sample-algorithm.html' title='UVa problem 11231: sample algorithm'/><author><name>Algorithm Share</name><uri>http://www.blogger.com/profile/05122107953495341186</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_2PJwbgod-iA/SXHGFsasYOI/AAAAAAAAADU/-if2UMiq4kc/s72-c/pic1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2271741171932159121.post-5209833002292491485</id><published>2009-01-17T02:53:00.000-08:00</published><updated>2009-01-17T02:58:31.052-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='UVA Online Judge'/><category scheme='http://www.blogger.com/atom/ns#' term='problem'/><category scheme='http://www.blogger.com/atom/ns#' term='11231'/><category scheme='http://www.blogger.com/atom/ns#' term='sample code'/><category scheme='http://www.blogger.com/atom/ns#' term='sample solution'/><category scheme='http://www.blogger.com/atom/ns#' term='sample algorithm'/><category scheme='http://www.blogger.com/atom/ns#' term='chess'/><category scheme='http://www.blogger.com/atom/ns#' term='Black and white painting'/><title type='text'>UVa problem 11231: sample code</title><content type='html'>&lt;pre&gt;&lt;br /&gt;001 #include "stdio.h"&lt;br /&gt;002 &lt;br /&gt;003 int main() {&lt;br /&gt;004   char   line[100]&lt;br /&gt;005        , first_box&lt;br /&gt;006        , black&lt;br /&gt;007        , white&lt;br /&gt;008        ;&lt;br /&gt;009 &lt;br /&gt;010   int   n&lt;br /&gt;011       , m&lt;br /&gt;012       , c&lt;br /&gt;013       , ne&lt;br /&gt;014       , me&lt;br /&gt;015       , code&lt;br /&gt;016       , x&lt;br /&gt;017       , y&lt;br /&gt;018       , z&lt;br /&gt;019       , q&lt;br /&gt;020       , r&lt;br /&gt;021       , s&lt;br /&gt;022       , v&lt;br /&gt;023       ;&lt;br /&gt;024 &lt;br /&gt;025   black = 'b';&lt;br /&gt;026   white = 'w';&lt;br /&gt;027 &lt;br /&gt;028   while (fgets(line, 100, stdin)) {&lt;br /&gt;029     sscanf(line, "%d %d %d", &amp;n, &amp;m, &amp;c);&lt;br /&gt;030 &lt;br /&gt;031     if (n == 0 &amp;&amp; m == 0 &amp;&amp; c== 0) {&lt;br /&gt;032       break;&lt;br /&gt;033     }&lt;br /&gt;034 &lt;br /&gt;035     ne = n &amp; 1;&lt;br /&gt;036     me = m &amp; 1;&lt;br /&gt;037 &lt;br /&gt;038     ne &lt;&lt;= 2;&lt;br /&gt;039     me &lt;&lt;= 1;&lt;br /&gt;040 &lt;br /&gt;041     code = 0;&lt;br /&gt;042     code = ne | me | c;&lt;br /&gt;043 &lt;br /&gt;044     if (code == 0) {&lt;br /&gt;045       first_box = black;&lt;br /&gt;046     }&lt;br /&gt;047     else if (code == 1) {&lt;br /&gt;048       first_box = white;&lt;br /&gt;049     }&lt;br /&gt;050     else if (code == 2) {&lt;br /&gt;051       first_box = white;&lt;br /&gt;052     }&lt;br /&gt;053     else if (code == 3) {&lt;br /&gt;054       first_box = black;&lt;br /&gt;055     }&lt;br /&gt;056     else if (code == 4) {&lt;br /&gt;057       first_box = white;&lt;br /&gt;058     }&lt;br /&gt;059     else if (code == 5) {&lt;br /&gt;060       first_box = black;&lt;br /&gt;061     }&lt;br /&gt;062     else if (code == 6) {&lt;br /&gt;063       first_box = black;&lt;br /&gt;064     }&lt;br /&gt;065     else {&lt;br /&gt;066       first_box = white;&lt;br /&gt;067     }&lt;br /&gt;068 &lt;br /&gt;069     if (first_box == white) {&lt;br /&gt;070       x = n - 6;&lt;br /&gt;071       x &gt;&gt;= 1;&lt;br /&gt;072 &lt;br /&gt;073       y = m - 6;&lt;br /&gt;074       y &gt;&gt;= 1;&lt;br /&gt;075 &lt;br /&gt;076       q = n - 7;&lt;br /&gt;077       q &gt;&gt;= 1;&lt;br /&gt;078 &lt;br /&gt;079       r = m - 7;&lt;br /&gt;080       r &gt;&gt;= 1;&lt;br /&gt;081     }&lt;br /&gt;082     else {&lt;br /&gt;083       x = n - 7;&lt;br /&gt;084       x &gt;&gt;= 1;&lt;br /&gt;085 &lt;br /&gt;086       y = m - 6;&lt;br /&gt;087       y &gt;&gt;= 1;&lt;br /&gt;088 &lt;br /&gt;089       q = n - 6;&lt;br /&gt;090       q &gt;&gt;= 1;&lt;br /&gt;091 &lt;br /&gt;092       r = m - 7;&lt;br /&gt;093       r &gt;&gt;= 1;&lt;br /&gt;094     }&lt;br /&gt;095 &lt;br /&gt;096     z = x * y;&lt;br /&gt;097     s = q * r;&lt;br /&gt;098 &lt;br /&gt;099     v = z + s;&lt;br /&gt;100 &lt;br /&gt;101     printf("%d\n", v);&lt;br /&gt;102   }&lt;br /&gt;103 &lt;br /&gt;104   return 0;&lt;br /&gt;105 }&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2271741171932159121-5209833002292491485?l=algoshare.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://algoshare.blogspot.com/feeds/5209833002292491485/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://algoshare.blogspot.com/2009/01/uva-problem-11231-sample-code.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/5209833002292491485'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/5209833002292491485'/><link rel='alternate' type='text/html' href='http://algoshare.blogspot.com/2009/01/uva-problem-11231-sample-code.html' title='UVa problem 11231: sample code'/><author><name>Algorithm Share</name><uri>http://www.blogger.com/profile/05122107953495341186</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2271741171932159121.post-5781814570267427343</id><published>2009-01-16T20:42:00.000-08:00</published><updated>2009-01-16T20:52:48.190-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='wikipedia'/><category scheme='http://www.blogger.com/atom/ns#' term='sample solution'/><category scheme='http://www.blogger.com/atom/ns#' term='algorithm'/><category scheme='http://www.blogger.com/atom/ns#' term='11417'/><category scheme='http://www.blogger.com/atom/ns#' term='article'/><category scheme='http://www.blogger.com/atom/ns#' term='division algorithm'/><category scheme='http://www.blogger.com/atom/ns#' term='UVA Online Judge'/><category scheme='http://www.blogger.com/atom/ns#' term='division'/><category scheme='http://www.blogger.com/atom/ns#' term='euclidean algorithm'/><category scheme='http://www.blogger.com/atom/ns#' term='greatest common divisor'/><category scheme='http://www.blogger.com/atom/ns#' term='GCD'/><category scheme='http://www.blogger.com/atom/ns#' term='remainder'/><category scheme='http://www.blogger.com/atom/ns#' term='sample algorithm'/><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><title type='text'>UVa problem 11417: sample algorithm</title><content type='html'>To solve problem 11417 (GCD), it would be beneficial if one knows about the Euclidean algorithm and division algorithm. One could search up "greatest common divisor" in Google and browse through the corresponding Wikipedia article.&lt;br /&gt;&lt;br /&gt;The algorithm to get the greatest common divisor between two numbers i and j can be best explained through an example. Consider i = 18 and j = 84, to get the GCD:&lt;br /&gt;&lt;br /&gt;84 / 18 = 4 R 12&lt;br /&gt;18 / 12 = 1 R  6&lt;br /&gt;12 /  6 = 2 R  0&lt;br /&gt;&lt;br /&gt;GCD for 18 and 84 is then 6.&lt;br /&gt;&lt;br /&gt;Another example: i = 16 and j = 56:&lt;br /&gt;&lt;br /&gt;56 / 16 = 3 R 8&lt;br /&gt;16 /  8 = 2 R 0&lt;br /&gt;&lt;br /&gt;GCD for 16 and 56 is then 8.&lt;br /&gt;&lt;br /&gt;In the process illustrated above, the divisor that caused the remainder to be 0 is the greatest common divisor.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2271741171932159121-5781814570267427343?l=algoshare.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://algoshare.blogspot.com/feeds/5781814570267427343/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://algoshare.blogspot.com/2009/01/uva-problem-11417-sample-algorithm.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/5781814570267427343'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/5781814570267427343'/><link rel='alternate' type='text/html' href='http://algoshare.blogspot.com/2009/01/uva-problem-11417-sample-algorithm.html' title='UVa problem 11417: sample algorithm'/><author><name>Algorithm Share</name><uri>http://www.blogger.com/profile/05122107953495341186</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2271741171932159121.post-7295196067288042464</id><published>2009-01-16T20:39:00.000-08:00</published><updated>2009-01-16T20:42:02.961-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='UVA Online Judge'/><category scheme='http://www.blogger.com/atom/ns#' term='problems'/><category scheme='http://www.blogger.com/atom/ns#' term='sample code'/><category scheme='http://www.blogger.com/atom/ns#' term='sample solution'/><category scheme='http://www.blogger.com/atom/ns#' term='greatest common divisor'/><category scheme='http://www.blogger.com/atom/ns#' term='algorithm'/><category scheme='http://www.blogger.com/atom/ns#' term='sample algorithm'/><category scheme='http://www.blogger.com/atom/ns#' term='GCD'/><category scheme='http://www.blogger.com/atom/ns#' term='11417'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>UVa problem 11417: sample code</title><content type='html'>&lt;pre&gt;&lt;br /&gt;001 #include "stdio.h"&lt;br /&gt;002 &lt;br /&gt;003 int main() {&lt;br /&gt;004   char line[100];&lt;br /&gt;005 &lt;br /&gt;006   int   n&lt;br /&gt;007       , g&lt;br /&gt;008       , i&lt;br /&gt;009       , j&lt;br /&gt;010       , k&lt;br /&gt;011       , i0&lt;br /&gt;012       , j0&lt;br /&gt;013       ;&lt;br /&gt;014 &lt;br /&gt;015   while (fgets(line, 100, stdin)) {&lt;br /&gt;016     sscanf(line, "%d", &amp;n);&lt;br /&gt;017 &lt;br /&gt;018     if (n == 0) {&lt;br /&gt;019       break;&lt;br /&gt;020     }&lt;br /&gt;021 &lt;br /&gt;022     for(i = 1, g = 0; i &lt; n; i++) {&lt;br /&gt;023       for(j = i + 1; j &lt;= n; j++) {&lt;br /&gt;024         i0 = i;&lt;br /&gt;025         j0 = j;&lt;br /&gt;026 &lt;br /&gt;027         for (; 1; ) {&lt;br /&gt;028           k = j % i;&lt;br /&gt;029 &lt;br /&gt;030           if (k == 0) {&lt;br /&gt;031             break;&lt;br /&gt;032           }&lt;br /&gt;033 &lt;br /&gt;034           j = i;&lt;br /&gt;035           i = k;&lt;br /&gt;036         }&lt;br /&gt;037         g += i;&lt;br /&gt;038 &lt;br /&gt;039         j = j0;&lt;br /&gt;040         i = i0;&lt;br /&gt;041       }    &lt;br /&gt;042     }&lt;br /&gt;043 &lt;br /&gt;044     printf("%d\n", g);&lt;br /&gt;045   }&lt;br /&gt;046 &lt;br /&gt;047   return 0;&lt;br /&gt;048 }&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2271741171932159121-7295196067288042464?l=algoshare.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://algoshare.blogspot.com/feeds/7295196067288042464/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://algoshare.blogspot.com/2009/01/uva-problem-11417-sample-code.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/7295196067288042464'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/7295196067288042464'/><link rel='alternate' type='text/html' href='http://algoshare.blogspot.com/2009/01/uva-problem-11417-sample-code.html' title='UVa problem 11417: sample code'/><author><name>Algorithm Share</name><uri>http://www.blogger.com/profile/05122107953495341186</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2271741171932159121.post-6284036096199517414</id><published>2009-01-16T01:12:00.000-08:00</published><updated>2009-01-16T01:18:22.113-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='UVA Online Judge'/><category scheme='http://www.blogger.com/atom/ns#' term='environmental friendliness'/><category scheme='http://www.blogger.com/atom/ns#' term='10300'/><category scheme='http://www.blogger.com/atom/ns#' term='land area'/><category scheme='http://www.blogger.com/atom/ns#' term='government'/><category scheme='http://www.blogger.com/atom/ns#' term='confuse'/><category scheme='http://www.blogger.com/atom/ns#' term='Ecological Premium'/><category scheme='http://www.blogger.com/atom/ns#' term='incentive'/><category scheme='http://www.blogger.com/atom/ns#' term='animals'/><title type='text'>UVa problem 10300: sample algorithm</title><content type='html'>For problem 10300, Ecological Premium, for each farmer case, one is given three parameters: land area (land_area), number of animals (num_animals), and degree of environmental friendliness (degree_friendliness). The problem describes that the premium due to the farmer is calculated as Equation 1.&lt;br /&gt;&lt;br /&gt;[Equation 1]&lt;br /&gt;premium = (land_area / num_animals) * degree_friendliness * num_animals&lt;br /&gt;&lt;br /&gt;But notice from Equation 1 that num_animals can be cancelled out to simplify the formula to Equation 2.&lt;br /&gt;&lt;br /&gt;[Equation 2]&lt;br /&gt;premium = land_area * degree_friendliness&lt;br /&gt;&lt;br /&gt;In this case, the num_animals parameter is not needed and is used to confused the solver.&lt;br /&gt;&lt;br /&gt;So, for a given test case, we calculate the premium for each farmer. Then we sum them up to obtain the burden due by the government.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2271741171932159121-6284036096199517414?l=algoshare.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://algoshare.blogspot.com/feeds/6284036096199517414/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://algoshare.blogspot.com/2009/01/uva-problem-10300-sample-algorithm.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/6284036096199517414'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/6284036096199517414'/><link rel='alternate' type='text/html' href='http://algoshare.blogspot.com/2009/01/uva-problem-10300-sample-algorithm.html' title='UVa problem 10300: sample algorithm'/><author><name>Algorithm Share</name><uri>http://www.blogger.com/profile/05122107953495341186</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2271741171932159121.post-3277764303700225966</id><published>2009-01-16T01:00:00.000-08:00</published><updated>2009-01-16T01:07:28.979-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='UVA Online Judge'/><category scheme='http://www.blogger.com/atom/ns#' term='problem'/><category scheme='http://www.blogger.com/atom/ns#' term='sample code'/><category scheme='http://www.blogger.com/atom/ns#' term='sample solution'/><category scheme='http://www.blogger.com/atom/ns#' term='10300'/><category scheme='http://www.blogger.com/atom/ns#' term='sample algorithm'/><category scheme='http://www.blogger.com/atom/ns#' term='Ecological Premium'/><title type='text'>UVa problem 10300: Sample code</title><content type='html'>&lt;pre&gt;&lt;br /&gt;001 #include "stdio.h"&lt;br /&gt;002 &lt;br /&gt;003 int main() {&lt;br /&gt;004   char   line[100]&lt;br /&gt;005        ;&lt;br /&gt;006 &lt;br /&gt;007   int   num_cases&lt;br /&gt;008       , num_farmers&lt;br /&gt;009       , i&lt;br /&gt;010       , j&lt;br /&gt;011       , area&lt;br /&gt;012       , num_animals&lt;br /&gt;013       , factor&lt;br /&gt;014       , burden&lt;br /&gt;015       ;&lt;br /&gt;016 &lt;br /&gt;017   fgets(line, 100, stdin);&lt;br /&gt;018   sscanf(line, "%d", &amp;num_cases);&lt;br /&gt;019 &lt;br /&gt;020   for (i = 0; i &lt; num_cases; i += 1) {&lt;br /&gt;021     fgets(line, 100, stdin);&lt;br /&gt;022     sscanf(line, "%d", &amp;num_farmers);&lt;br /&gt;023 &lt;br /&gt;024     for (j = 0, burden = 0; j &lt; num_farmers; j += 1) {&lt;br /&gt;025       fgets(line, 100, stdin);&lt;br /&gt;026       sscanf(line, "%d %d %d", &amp;area, &amp;num_animals, &amp;factor);&lt;br /&gt;027 &lt;br /&gt;028       burden += area * factor;&lt;br /&gt;029     }&lt;br /&gt;030 &lt;br /&gt;031     printf("%d\n", burden);&lt;br /&gt;032   }&lt;br /&gt;033 &lt;br /&gt;034   return 0;&lt;br /&gt;035 }&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2271741171932159121-3277764303700225966?l=algoshare.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://algoshare.blogspot.com/feeds/3277764303700225966/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://algoshare.blogspot.com/2009/01/uva-problem-10300-sample-code.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/3277764303700225966'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/3277764303700225966'/><link rel='alternate' type='text/html' href='http://algoshare.blogspot.com/2009/01/uva-problem-10300-sample-code.html' title='UVa problem 10300: Sample code'/><author><name>Algorithm Share</name><uri>http://www.blogger.com/profile/05122107953495341186</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2271741171932159121.post-3467526751115917179</id><published>2009-01-10T18:54:00.000-08:00</published><updated>2009-01-10T19:49:09.358-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='UVA Online Judge'/><category scheme='http://www.blogger.com/atom/ns#' term='division'/><category scheme='http://www.blogger.com/atom/ns#' term='64-bit integers'/><category scheme='http://www.blogger.com/atom/ns#' term='10633'/><category scheme='http://www.blogger.com/atom/ns#' term='pattern'/><category scheme='http://www.blogger.com/atom/ns#' term='tricky'/><category scheme='http://www.blogger.com/atom/ns#' term='large numbers'/><category scheme='http://www.blogger.com/atom/ns#' term='32-bit integers'/><category scheme='http://www.blogger.com/atom/ns#' term='unsigned long long int'/><category scheme='http://www.blogger.com/atom/ns#' term='big numbers'/><category scheme='http://www.blogger.com/atom/ns#' term='rare easy problem'/><title type='text'>UVA problem 10633: sample algorithm</title><content type='html'>Problem 10633 may be entitled "Rare Easy Problem" but I do not think it is that easy. It is tricky as well as a little technical as well as tricky. So one has to be very careful with this before submitting.&lt;br /&gt;&lt;br /&gt;We define the difference between N and M in Equation 1.&lt;br /&gt;&lt;br /&gt;Y = N - M. [Equation 1]&lt;br /&gt;&lt;br /&gt;Since M is formed by chopping off the last digit from N, we have Equation 2.&lt;br /&gt;&lt;br /&gt;M = N / 10 [Equation 2]&lt;br /&gt;&lt;br /&gt;Using Equation 2, Equation 1 can be expressed as Equation 3.&lt;br /&gt;&lt;br /&gt;Y = N - (N / 10) [Equation 3]&lt;br /&gt;&lt;br /&gt;Using a little algebra, Equation 3 can be transformed to get N as a function of Y.&lt;br /&gt;&lt;br /&gt;N = (10 / 9) * Y [Equation 4]&lt;br /&gt;&lt;br /&gt;Equation 4 then provides us a way of calculating N given the input Y.&lt;br /&gt;&lt;br /&gt;But then we seem to have another problem. Equation 4 will only lead to one value of N given Y. That does not make sense because for example, given Y = 18, N can be 19 or 20, which gives us two possible answers for N, whereas Equation 4 only provides us one answer.&lt;br /&gt;&lt;br /&gt;To solve this mystery, we have to analyze the pattern of some answers. Table 1 provides a listing of Y values followed by the corresponding N values.&lt;br /&gt;&lt;br /&gt;Table 1. Listing of Y and corresponding N values.&lt;br /&gt;Y, N&lt;br /&gt;10, 11&lt;br /&gt;11, 12&lt;br /&gt;12, 13&lt;br /&gt;13, 14&lt;br /&gt;14, 15&lt;br /&gt;15, 16&lt;br /&gt;16, 17&lt;br /&gt;17, 18&lt;br /&gt;18, 19 20&lt;br /&gt;19, 21&lt;br /&gt;20, 22&lt;br /&gt;21, 23&lt;br /&gt;22, 24&lt;br /&gt;23, 25&lt;br /&gt;24, 26&lt;br /&gt;25, 27&lt;br /&gt;26, 28&lt;br /&gt;27, 29 30&lt;br /&gt;28, 31&lt;br /&gt;29, 32&lt;br /&gt;30, 33&lt;br /&gt;31, 34&lt;br /&gt;32, 35&lt;br /&gt;33, 36&lt;br /&gt;34, 37&lt;br /&gt;35, 38&lt;br /&gt;36, 39 40&lt;br /&gt;37, 41&lt;br /&gt;38, 42&lt;br /&gt;106, 117&lt;br /&gt;107, 118&lt;br /&gt;108, 119, 120&lt;br /&gt;109, 121&lt;br /&gt;110, 122&lt;br /&gt;&lt;br /&gt;Analyzing Table 1 reveals that for any given Y, there can be one or two values of N. Also notice that N has two values only when Y is divisible by 9. When Y is divisible by 9, N has two values N1 and N2 given by Equation 5.&lt;br /&gt;&lt;br /&gt;[Equation 5]&lt;br /&gt;N1 = (10 / 9) * Y&lt;br /&gt;N2 = N1 - 1&lt;br /&gt;&lt;br /&gt;So the algorithm is given by Equation 5. There's one more issue though. The problem requires that the solution be able to accept inputs as large as 10^18. That's a big input number.&lt;br /&gt;&lt;br /&gt;If we used an ordinary integer to represent Y, the integer would most likely be able to accommodate up to 2 billion only assuming a 32-bit signed integer. 10^18 is the following number:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;1,000,000,000,000,000,000&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;___6___5___4___3___2___1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;2^31 is the following number:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;2,147,483,648&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;___3___2___1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Obviously, the ordinary integer will not be able to hold 10^18.&lt;br /&gt;&lt;br /&gt;If we use an unsigned long long int (assuming that the C language is used), the maximum integer value would be increased to 2^64 (subtract 1 from that to be more accurate):&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;18,446,744,073,709,551,616&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;____6___5___4___3___2___1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Well 2^64 seems quite certainly to be greater than 10^18 by a magnitude of about 18.&lt;br /&gt;&lt;br /&gt;Alternatively, Equation 5 can be expressed as Equation 6 for N1 which is what I did in the sample code.&lt;br /&gt;&lt;br /&gt;N1 = Y + (Y / 9) [Equation 6]&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2271741171932159121-3467526751115917179?l=algoshare.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://algoshare.blogspot.com/feeds/3467526751115917179/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://algoshare.blogspot.com/2009/01/uva-problem-10633-sample-algorithm.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/3467526751115917179'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/3467526751115917179'/><link rel='alternate' type='text/html' href='http://algoshare.blogspot.com/2009/01/uva-problem-10633-sample-algorithm.html' title='UVA problem 10633: sample algorithm'/><author><name>Algorithm Share</name><uri>http://www.blogger.com/profile/05122107953495341186</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2271741171932159121.post-8741237508535346775</id><published>2009-01-10T18:46:00.000-08:00</published><updated>2009-01-10T18:49:46.716-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='UVA Online Judge'/><category scheme='http://www.blogger.com/atom/ns#' term='64-bit integers'/><category scheme='http://www.blogger.com/atom/ns#' term='10633'/><category scheme='http://www.blogger.com/atom/ns#' term='sample code'/><category scheme='http://www.blogger.com/atom/ns#' term='sample solution'/><category scheme='http://www.blogger.com/atom/ns#' term='big numbers'/><category scheme='http://www.blogger.com/atom/ns#' term='rare easy problem'/><category scheme='http://www.blogger.com/atom/ns#' term='overflow'/><title type='text'>UVA problem 10633: sample code</title><content type='html'>&lt;pre&gt;&lt;br /&gt;001 #include "stdio.h"&lt;br /&gt;002 #include "iostream"&lt;br /&gt;003 &lt;br /&gt;004 using namespace std;&lt;br /&gt;005 &lt;br /&gt;006 int main() {&lt;br /&gt;007   char line[100];&lt;br /&gt;008   unsigned long long&lt;br /&gt;009         x&lt;br /&gt;010       , y&lt;br /&gt;011       , z&lt;br /&gt;012       , m&lt;br /&gt;013       , n&lt;br /&gt;014       ;&lt;br /&gt;015 &lt;br /&gt;016   while (1) {&lt;br /&gt;017     cin &gt;&gt; y;&lt;br /&gt;018 &lt;br /&gt;019     if (y == 0) {&lt;br /&gt;020       break;&lt;br /&gt;021     }&lt;br /&gt;022 &lt;br /&gt;023     x = y / 9;&lt;br /&gt;024     n = y + x;&lt;br /&gt;025 &lt;br /&gt;026     z = x * 9;&lt;br /&gt;027     if (z == y) {&lt;br /&gt;028       m = n - 1;&lt;br /&gt;029       cout &lt;&lt; m &lt;&lt; " ";&lt;br /&gt;030     }&lt;br /&gt;031 &lt;br /&gt;032     cout &lt;&lt; n &lt;&lt; endl;&lt;br /&gt;033   }&lt;br /&gt;034 &lt;br /&gt;035   return 0;&lt;br /&gt;036 }&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2271741171932159121-8741237508535346775?l=algoshare.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://algoshare.blogspot.com/feeds/8741237508535346775/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://algoshare.blogspot.com/2009/01/uva-problem-10633-sample-code.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/8741237508535346775'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/8741237508535346775'/><link rel='alternate' type='text/html' href='http://algoshare.blogspot.com/2009/01/uva-problem-10633-sample-code.html' title='UVA problem 10633: sample code'/><author><name>Algorithm Share</name><uri>http://www.blogger.com/profile/05122107953495341186</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2271741171932159121.post-2086875909890097986</id><published>2009-01-01T23:14:00.001-08:00</published><updated>2009-01-01T23:26:26.953-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='UVA Online Judge'/><category scheme='http://www.blogger.com/atom/ns#' term='grey codes'/><category scheme='http://www.blogger.com/atom/ns#' term='11173'/><category scheme='http://www.blogger.com/atom/ns#' term='sample algorithm'/><category scheme='http://www.blogger.com/atom/ns#' term='bit-shift'/><category scheme='http://www.blogger.com/atom/ns#' term='gray codes'/><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><category scheme='http://www.blogger.com/atom/ns#' term='trivia'/><category scheme='http://www.blogger.com/atom/ns#' term='xor'/><title type='text'>UVa problem 11173: sample algorithm</title><content type='html'>To solve UVa problem 11173 (Grey codes), one needs to know a trivia. I know it's quite unfair but that's the way it really is.&lt;br /&gt;&lt;br /&gt;I actually spent hours trying to code this thing, trying to accurately simulate the reflection algorithm so vividly and exquisitely described by the problem. Then when I submitted, the online judge said I maxed out the time limit. Then I spent a few more hours figuring out how in the world to speed up this program.&lt;br /&gt;&lt;br /&gt;Turned out the vivid description was a trick, a deception into leading me that that was the way to solve the problem. It was to divert my attention into thinking that there was no other way to solve it but to manually do the instruction on reflection step by step.&lt;br /&gt;&lt;br /&gt;Then after surrendering, after some while, I thought that maybe there's some clue out there in Google. So I looked up "gray codes" in Google, and guess what? You guessed right. There was a trivia I had to know. To convert from binary to gray code, one only needed a bit shift and an xor bit-wise operation. Try googling it up.&lt;br /&gt;&lt;br /&gt;The formula is disappointingly just a single statement to solve this problem:&lt;br /&gt;&lt;br /&gt;g = b ^ (b &gt;&gt; 1);&lt;br /&gt;&lt;br /&gt;where g stands for the gray code and b stands for the binary number.&lt;br /&gt;&lt;br /&gt;That simple and it took me about 4 hours to figure this out. When I learned of this trivia, it took me less than 5 minutes to solve the problem. It's crazy.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2271741171932159121-2086875909890097986?l=algoshare.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://algoshare.blogspot.com/feeds/2086875909890097986/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://algoshare.blogspot.com/2009/01/uva-problem-11173-sample-algorithm.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/2086875909890097986'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/2086875909890097986'/><link rel='alternate' type='text/html' href='http://algoshare.blogspot.com/2009/01/uva-problem-11173-sample-algorithm.html' title='UVa problem 11173: sample algorithm'/><author><name>Algorithm Share</name><uri>http://www.blogger.com/profile/05122107953495341186</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2271741171932159121.post-4937131199331163776</id><published>2009-01-01T23:08:00.000-08:00</published><updated>2009-01-01T23:27:11.867-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='UVA Online Judge'/><category scheme='http://www.blogger.com/atom/ns#' term='sample code'/><category scheme='http://www.blogger.com/atom/ns#' term='sample solution'/><category scheme='http://www.blogger.com/atom/ns#' term='grey codes'/><category scheme='http://www.blogger.com/atom/ns#' term='11173'/><title type='text'>UVa problem 11173: sample code</title><content type='html'>&lt;pre&gt;&lt;br /&gt;001 #include "stdio.h"&lt;br /&gt;002 &lt;br /&gt;003 int main() {&lt;br /&gt;004   char line[100];&lt;br /&gt;005   int   num_tests&lt;br /&gt;006       , i&lt;br /&gt;007       , j&lt;br /&gt;008       , k&lt;br /&gt;009       , g&lt;br /&gt;010       ;&lt;br /&gt;011 &lt;br /&gt;012   fgets(line, 100, stdin);&lt;br /&gt;013   sscanf(line, "%d", &amp;num_tests);&lt;br /&gt;014 &lt;br /&gt;015   for (i = 0; i &lt; num_tests; i += 1) {&lt;br /&gt;016     fgets(line, 100, stdin);&lt;br /&gt;017     sscanf(line, "%d %d", &amp;j, &amp;k);&lt;br /&gt;018     &lt;br /&gt;019     g = k ^ (k &gt;&gt; 1);&lt;br /&gt;020 &lt;br /&gt;021     printf ("%d\n", g);&lt;br /&gt;022   }&lt;br /&gt;023 }&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2271741171932159121-4937131199331163776?l=algoshare.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://algoshare.blogspot.com/feeds/4937131199331163776/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://algoshare.blogspot.com/2009/01/uva-problem-11173-sample-code.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/4937131199331163776'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/4937131199331163776'/><link rel='alternate' type='text/html' href='http://algoshare.blogspot.com/2009/01/uva-problem-11173-sample-code.html' title='UVa problem 11173: sample code'/><author><name>Algorithm Share</name><uri>http://www.blogger.com/profile/05122107953495341186</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2271741171932159121.post-2901654412304650407</id><published>2009-01-01T04:47:00.000-08:00</published><updated>2009-01-01T04:59:47.236-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='UVA Online Judge'/><category scheme='http://www.blogger.com/atom/ns#' term='strtok'/><category scheme='http://www.blogger.com/atom/ns#' term='computer programming'/><category scheme='http://www.blogger.com/atom/ns#' term='for-loop'/><category scheme='http://www.blogger.com/atom/ns#' term='words'/><category scheme='http://www.blogger.com/atom/ns#' term='parsing'/><category scheme='http://www.blogger.com/atom/ns#' term='fgets'/><category scheme='http://www.blogger.com/atom/ns#' term='tokenizing'/><title type='text'>Parsing words</title><content type='html'>Suppose, a user inputs the line in Code 1 (without the quotations).&lt;br /&gt;&lt;br /&gt;Code 1. Sample input by user.&lt;br /&gt;&lt;span style="font-family:courier new;color:#cc33cc;"&gt;&lt;pre&gt;“  My name           is   Earl ”&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;And you need to parse the words “My”, “name”, “is” and “Earl”. How do you do that? Note that the spaces and/or tabs between words, or before or after each word may be zero or more spaces and/or tabs. This just makes parsing more complicated, doesn’t it?&lt;br /&gt;&lt;br /&gt;People have different ways of doing things. Let me present my way in Code 2.&lt;br /&gt;&lt;br /&gt;Code 2. Sample code for parsing words.&lt;br /&gt;&lt;span style="font-family:courier new;color:#cc33cc;"&gt;001 #include "stdio.h"&lt;br /&gt;002&lt;br /&gt;003 int main() {&lt;br /&gt;004 __char line[100], ctmp[100];&lt;br /&gt;005 __int i, j;&lt;br /&gt;006&lt;br /&gt;007 __fgets(line, 100, stdin);&lt;br /&gt;008&lt;br /&gt;009 __for (i = 0; 1; i += 1) {&lt;br /&gt;010 ____if (line[i] == '\n' line[i] == 0) {&lt;br /&gt;011 ______break;&lt;br /&gt;012 ____}&lt;br /&gt;013&lt;br /&gt;014 ____if (line[i] == ' ' line[i] == '\t') {&lt;br /&gt;015 ______continue;&lt;br /&gt;016 ____}&lt;br /&gt;017&lt;br /&gt;018 ____for (j = 0; 1 ; i += 1, j += 1) {&lt;br /&gt;019 ______if ( line[i] == ' '&lt;br /&gt;020 _________ line[i] == '\t'&lt;br /&gt;021 _________ line[i] == '\n'&lt;br /&gt;022 _________ line[i] == 0&lt;br /&gt;023 ______) {&lt;br /&gt;024 ________break;&lt;br /&gt;025 ______}&lt;br /&gt;026 ______ctmp[j] = line[i];&lt;br /&gt;027 ____}&lt;br /&gt;028 ____ctmp[j] = 0;&lt;br /&gt;029&lt;br /&gt;030 ____printf("B%sE\n", ctmp);&lt;br /&gt;031 __}&lt;br /&gt;032 }&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Of course, there are easier ways like I could use strtok or other more sophisticated methods available. But somehow, I never learned how to use them, had a hard time trying to configure them, and eventually, I ended up just using the code in Code 2 after tiring frustrations one after the other.&lt;br /&gt;&lt;br /&gt;The code in Code 2 uses the fgets function in line 007 to get an input line from the user. The for loop in line 009 is then used to process the input character by character.&lt;br /&gt;&lt;br /&gt;The for loop starts by checking if the current character it is processing is an end character which can either be a carriage return or a null character (line 010). If the current character is an end character, the loop breaks and processing of the input line is finished.&lt;br /&gt;&lt;br /&gt;If the loop determines that the current character is not an end character, it does a another check to see if the current character being processed is a white space which could be a literal space character or a tab character (line 014). If it is a white space character, the loop restarts with the next character.&lt;br /&gt;&lt;br /&gt;So, what checks 010 and 014 do is to find a character that is not an end character and at the same time, not a white space also. If a character passes these two initial checks, then we know that we have come across a character that is the beginning of a word because the character is neither an end character or a white space.&lt;br /&gt;&lt;br /&gt;The loop then enters into a second for loop (line 018). The second for loop first checks if the character is an end character or a white space (line 019). If it is, it means that we have reached the end of a word and so we break out of the second for loop to break further processing of the current word being parsed out.&lt;br /&gt;&lt;br /&gt;In the second for loop, if the current character passes the check of line 019, meaning that the current character is a valid character for a word – valid meaning that it could be alphanumeric or any other character as long as it is not an end character or a white space, then the current character is added into the current word being formed (ctmp).&lt;br /&gt;&lt;br /&gt;So the second for loop keeps looping, concatenating one character after another until the end of the word is detected through a character that is either an end character or a white space. A null character is then added to the end of the word to signify the end of the character string (line 028).&lt;br /&gt;&lt;br /&gt;After we have formed a word, we can pretty much do anything we want to do with the word parsed out from the input line. In Code 2, we simply print it (line 030).&lt;br /&gt;&lt;br /&gt;So we go back to the first for loop and repeat the process all over again until all characters in the input line are processed.&lt;br /&gt;&lt;br /&gt;Figure 1 shows a sample output of Code 2 when it is ran with the input of Code 1.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_2PJwbgod-iA/SVy7XPKmWDI/AAAAAAAAACs/HxDoTXVQ0QU/s1600-h/pic1.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5286306070508492850" style="WIDTH: 400px; CURSOR: hand; HEIGHT: 202px" alt="" src="http://1.bp.blogspot.com/_2PJwbgod-iA/SVy7XPKmWDI/AAAAAAAAACs/HxDoTXVQ0QU/s400/pic1.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 1. Output when Code 2 is inputted with the input of Code 1.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2271741171932159121-2901654412304650407?l=algoshare.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://algoshare.blogspot.com/feeds/2901654412304650407/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://algoshare.blogspot.com/2009/01/parsing-words.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/2901654412304650407'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/2901654412304650407'/><link rel='alternate' type='text/html' href='http://algoshare.blogspot.com/2009/01/parsing-words.html' title='Parsing words'/><author><name>Algorithm Share</name><uri>http://www.blogger.com/profile/05122107953495341186</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_2PJwbgod-iA/SVy7XPKmWDI/AAAAAAAAACs/HxDoTXVQ0QU/s72-c/pic1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2271741171932159121.post-4192479955540373003</id><published>2009-01-01T03:57:00.000-08:00</published><updated>2009-01-01T04:05:16.471-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='UVA Online Judge'/><category scheme='http://www.blogger.com/atom/ns#' term='Brownie points'/><category scheme='http://www.blogger.com/atom/ns#' term='cartesian plane'/><category scheme='http://www.blogger.com/atom/ns#' term='quadrants'/><category scheme='http://www.blogger.com/atom/ns#' term='algorithm'/><category scheme='http://www.blogger.com/atom/ns#' term='10865'/><title type='text'>UVa problem 10865: sample algorithm</title><content type='html'>To solve problem 10865 (Brownie Points), one can imagine the plane divided into 4 quadrants like in Figure 1.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_2PJwbgod-iA/SVyv7Plf_PI/AAAAAAAAACk/PKiHFutdJo8/s1600-h/pic1.GIF"&gt;&lt;img id="BLOGGER_PHOTO_ID_5286293494957079794" style="WIDTH: 400px; CURSOR: hand; HEIGHT: 311px" alt="" src="http://2.bp.blogspot.com/_2PJwbgod-iA/SVyv7Plf_PI/AAAAAAAAACk/PKiHFutdJo8/s400/pic1.GIF" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 1. Plane divided into 4 quadrants.&lt;br /&gt;&lt;br /&gt;In Figure 1, Stan draws his vertical line while Ollie draws his horizontal line so that the two lines intersect to form the center point with coordinates (x0, y0).&lt;br /&gt;&lt;br /&gt;The center point corresponds to the middle of the input sequence provided by the user. Please refer to Figure 2 for an illustration.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_2PJwbgod-iA/SVyv1w3hWbI/AAAAAAAAACc/H11Deb9Xsi4/s1600-h/pic2.GIF"&gt;&lt;img id="BLOGGER_PHOTO_ID_5286293400811821490" style="WIDTH: 400px; CURSOR: hand; HEIGHT: 232px" alt="" src="http://3.bp.blogspot.com/_2PJwbgod-iA/SVyv1w3hWbI/AAAAAAAAACc/H11Deb9Xsi4/s400/pic2.GIF" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 2. The middle point corresponds to the center point.&lt;br /&gt;&lt;br /&gt;In Figure 2, x0 is equal to 1 and y0 is equal to -3.&lt;br /&gt;&lt;br /&gt;In Figure 1, the plane is divided into 4 quadrants: pp, pn, np and nn. The quadrant pp corresponds to that portion of the plain that is above and to the right of the center point. The quadrant pn corresponds to that which is below and to the right. The quadrant np corresponds to that which is above and to the left. The quadrant nn corresponds to that which is below and to the left.&lt;br /&gt;&lt;br /&gt;So given a random point (x, y), we check to which quadrant it belongs to by comparing x against x0 and y against y0. For example, for the first point in Figure2 (3, 2), x &gt; x0 since 3 &gt; 1, and y &gt; y0 since 2 &gt; -3. As such the point (3, 2) is to the right and above the center point (1, -3). Hence it belongs to the quadrant pp.&lt;br /&gt;&lt;br /&gt;For each point then, we determine the quadrant to which it belongs. Then we sum up the number of points belonging to each quadrant. Stan’s score is simply the number of points within pp and nn, while Ollie score is the number of points within pn and np.&lt;br /&gt;&lt;br /&gt;Note also that if x is equal to x0, or if y is equal to y0, we do not accumulate the point into the total of any quadrant, as the problem states that crossed brownies do not count.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2271741171932159121-4192479955540373003?l=algoshare.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://algoshare.blogspot.com/feeds/4192479955540373003/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://algoshare.blogspot.com/2009/01/uva-problem-10865-sample-algorithm.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/4192479955540373003'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/4192479955540373003'/><link rel='alternate' type='text/html' href='http://algoshare.blogspot.com/2009/01/uva-problem-10865-sample-algorithm.html' title='UVa problem 10865: sample algorithm'/><author><name>Algorithm Share</name><uri>http://www.blogger.com/profile/05122107953495341186</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_2PJwbgod-iA/SVyv7Plf_PI/AAAAAAAAACk/PKiHFutdJo8/s72-c/pic1.GIF' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2271741171932159121.post-1599976160687247363</id><published>2009-01-01T03:22:00.000-08:00</published><updated>2009-01-01T03:23:31.513-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='UVA Online Judge'/><category scheme='http://www.blogger.com/atom/ns#' term='Brownie points'/><category scheme='http://www.blogger.com/atom/ns#' term='problem'/><category scheme='http://www.blogger.com/atom/ns#' term='sample code'/><category scheme='http://www.blogger.com/atom/ns#' term='sample solution'/><category scheme='http://www.blogger.com/atom/ns#' term='10865'/><title type='text'>UVa problem 10865: sample code</title><content type='html'>&lt;pre&gt;&lt;br /&gt;001 #include "stdio.h"&lt;br /&gt;002 &lt;br /&gt;003 int main() {&lt;br /&gt;004   char   line[100]&lt;br /&gt;005        ;&lt;br /&gt;006   int   i&lt;br /&gt;007       , x&lt;br /&gt;008       , y&lt;br /&gt;009       , x0&lt;br /&gt;010       , y0&lt;br /&gt;011       , num_points&lt;br /&gt;012       , grid[200000][2]&lt;br /&gt;013       , middle&lt;br /&gt;014       , pp&lt;br /&gt;015       , pn&lt;br /&gt;016       , np&lt;br /&gt;017       , nn&lt;br /&gt;018       , stan&lt;br /&gt;019       , ollie&lt;br /&gt;020       ;&lt;br /&gt;021 &lt;br /&gt;022   while (fgets(line, 100, stdin)) {&lt;br /&gt;023     sscanf(line, "%d", &amp;num_points);&lt;br /&gt;024 &lt;br /&gt;025     if (num_points == 0) {&lt;br /&gt;026       break;&lt;br /&gt;027     }&lt;br /&gt;028 &lt;br /&gt;029     for (i = 0; i &lt; num_points; i += 1) {&lt;br /&gt;030       fgets(line, 100, stdin);&lt;br /&gt;031       sscanf(line, "%d %d", &amp;x, &amp;y);&lt;br /&gt;032 &lt;br /&gt;033       grid[i][0] = x;&lt;br /&gt;034       grid[i][1] = y;&lt;br /&gt;035     }&lt;br /&gt;036 &lt;br /&gt;037     middle = num_points &gt;&gt; 1;&lt;br /&gt;038     x0 = grid[middle][0];&lt;br /&gt;039     y0 = grid[middle][1];&lt;br /&gt;040 &lt;br /&gt;041     pp = 0;&lt;br /&gt;042     pn = 0;&lt;br /&gt;043     np = 0;&lt;br /&gt;044     nn = 0;&lt;br /&gt;045 &lt;br /&gt;046     for (i = 0; i &lt; num_points; i += 1) {&lt;br /&gt;047       x = grid[i][0];&lt;br /&gt;048       y = grid[i][1];&lt;br /&gt;049 &lt;br /&gt;050       if (x == x0 || y == y0) {&lt;br /&gt;051         continue;&lt;br /&gt;052       }&lt;br /&gt;053       else if (x &gt; x0 &amp;&amp; y &gt; y0) {&lt;br /&gt;054         pp += 1;&lt;br /&gt;055       }&lt;br /&gt;056       else if (x &gt; x0 &amp;&amp; y &lt; y0) {&lt;br /&gt;057         pn += 1;&lt;br /&gt;058       }&lt;br /&gt;059       else if (x &lt; x0 &amp;&amp; y &gt; y0) {&lt;br /&gt;060         np += 1;&lt;br /&gt;061       }&lt;br /&gt;062       else {&lt;br /&gt;063         nn += 1;&lt;br /&gt;064       }&lt;br /&gt;065     }&lt;br /&gt;066 &lt;br /&gt;067     stan = pp + nn;&lt;br /&gt;068     ollie = np + pn;&lt;br /&gt;069 &lt;br /&gt;070     printf("%d %d\n", stan, ollie);&lt;br /&gt;071   }&lt;br /&gt;072 &lt;br /&gt;073   return 0;&lt;br /&gt;074 }&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2271741171932159121-1599976160687247363?l=algoshare.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://algoshare.blogspot.com/feeds/1599976160687247363/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://algoshare.blogspot.com/2009/01/uva-problem-10865-sample-code.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/1599976160687247363'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/1599976160687247363'/><link rel='alternate' type='text/html' href='http://algoshare.blogspot.com/2009/01/uva-problem-10865-sample-code.html' title='UVa problem 10865: sample code'/><author><name>Algorithm Share</name><uri>http://www.blogger.com/profile/05122107953495341186</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2271741171932159121.post-8709267942700836744</id><published>2008-12-30T01:15:00.000-08:00</published><updated>2008-12-30T01:27:26.492-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='UVA Online Judge'/><category scheme='http://www.blogger.com/atom/ns#' term='statistics'/><category scheme='http://www.blogger.com/atom/ns#' term='rejected submissions'/><category scheme='http://www.blogger.com/atom/ns#' term='programming contests'/><category scheme='http://www.blogger.com/atom/ns#' term='hard problems'/><category scheme='http://www.blogger.com/atom/ns#' term='easy problems'/><category scheme='http://www.blogger.com/atom/ns#' term='frustration'/><title type='text'>Finding the easy problems</title><content type='html'>For starters, it would be best to try to solve the easier problems first. If one tried solving the hard problems first, then he might get frustrated immediately from getting rejected submissions one after the other. It could also happen that he would get stuck in a single problem for several days and end up extremely disappointed in programming and swearing never to do programming again.&lt;br /&gt;&lt;br /&gt;For competitors in a contest, it is also best to find, solve and submit the easier problems first given a set of problems. Otherwise, one might spend so much time in a single hard problem that he losses time that could have been more productively used to submit much easier problems. So instead of submitting 3 easy problems at the end of the contest, he only submits 1 hard problem. But the weight of the easy problem is just the same weight as a hard problem in a programming competition.&lt;br /&gt;&lt;br /&gt;So, when one starts a contest, before solving any problem, he should scan and sort out which problems are easier to solve first. Then he should solve the easier problems first. If he wishes to win, then he should resist the temptation of solving the hard problem first for whatever reason. The easy problem and the hard problem would earn one the same amount of money if the contest awarded cash prizes. So why should one consume all his time in solving a hard problem, unless he is not after winning the contest and just simply after programming insight enlightenment?&lt;br /&gt;&lt;br /&gt;In this post, I discuss about finding easy problems in the UVa problem archive. Easy problems are only relative in the sense that they are easy compared to the other problems also existing within the archive. So how do we define relativity? Through statistics.&lt;br /&gt;&lt;br /&gt;Figure 1 shows a screenshot of the problem archive where statistics are shown for each problem.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_2PJwbgod-iA/SVnnLShKfEI/AAAAAAAAACU/BpeolwJgjjI/s1600-h/pic1.GIF"&gt;&lt;img id="BLOGGER_PHOTO_ID_5285509818831502402" style="WIDTH: 400px; CURSOR: hand; HEIGHT: 158px" alt="" src="http://3.bp.blogspot.com/_2PJwbgod-iA/SVnnLShKfEI/AAAAAAAAACU/BpeolwJgjjI/s400/pic1.GIF" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 1. Screenshot of the problem archive.&lt;br /&gt;&lt;br /&gt;Two ratio statistics are shown for each problem. The first one is the ratio of accepted submissions to total submissions. Let’s call this the BR ratio. For example, for problem 10800, the BR ratio is 19.73%. The second ratio is the ratio of number of users who actually solved the problem to the total number of users who attempted to solve the problem regardless of whether they solved it or not. Let’s call this the UR ratio. For problem 10800, the UR ratio is 67.51%.&lt;br /&gt;&lt;br /&gt;Two other statistics exist which are the total submissions for a problem (B value) and the total number of users who attempted to solve a problem (U value).  For problem 10800, B is 5039 meaning there were 5039 submissions for this problem whether the submissions were accepted or rejected. For the same problem, U is 1265, meaning there were 1265 users who submitted solutions whether their solutions were accepted or not.&lt;br /&gt;&lt;br /&gt;So given this statistics, how do we interpret them? Generally, to find an easy problem, we would want to look for one which has a relatively high BR ratio. This means that an easy problem would be a problem for which most submissions were accepted because it was easy to solve so most people solved it in their first attempt or submission.&lt;br /&gt;&lt;br /&gt;Figure 2 shows an example were an easy problem is visually spotted out.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_2PJwbgod-iA/SVnnHHCVP_I/AAAAAAAAACM/Da-NazIHe5Q/s1600-h/pic2.GIF"&gt;&lt;img id="BLOGGER_PHOTO_ID_5285509747029917682" style="WIDTH: 400px; CURSOR: hand; HEIGHT: 145px" alt="" src="http://1.bp.blogspot.com/_2PJwbgod-iA/SVnnHHCVP_I/AAAAAAAAACM/Da-NazIHe5Q/s400/pic2.GIF" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 2.  Problem 10865 is likely to be an easy problem.&lt;br /&gt;&lt;br /&gt;In Figure 2, one can easily point out that problem 10865 can likely be an easy problem because of the high BR ratio relative to its surrounding neighbor problems. The BR ratio stands out at 71%. Its closest rival has a BR ratio of 55.81%. The 71% BR ratio means that for about every 10 submissions, 7 of those were accepted. With a higher statistical historical ratio, one’s likelihood of solving the problem becomes higher. So it would be better if one start with such easy problems when starting his career in programming in order not to get frustrated at the start of his career immediately.&lt;br /&gt;&lt;br /&gt;There is a watch out though. Figure 3 shows an example.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;a href="http://2.bp.blogspot.com/_2PJwbgod-iA/SVnnAyLTFFI/AAAAAAAAACE/lGGUHDiDvko/s1600-h/pic3.GIF"&gt;&lt;img id="BLOGGER_PHOTO_ID_5285509638351164498" style="WIDTH: 400px; CURSOR: hand; HEIGHT: 174px" alt="" src="http://2.bp.blogspot.com/_2PJwbgod-iA/SVnnAyLTFFI/AAAAAAAAACE/lGGUHDiDvko/s400/pic3.GIF" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 3. Problem 717 appears to be an easy one but could be actually a real hard one.&lt;br /&gt;&lt;br /&gt;In Figure 3, problem 717 stands out easily with a BR ratio of 83.33%. This ratio is very high compared to other problems’ ratios. But looking at its B value of only 18, something looks fishy. The B value is very low which means that out of the tens of thousands of coders, only 18 solutions were submitted. Looking at the U value reveals something even more dismal: only 12 users attempted to solve this problem.&lt;br /&gt;&lt;br /&gt;So why did most users avoid this problem as only 12 out of the tens of thousands of coders attempted to try this problem? Most probably this problem is a difficult one which most coders have no idea on how to solve. And those who attempted to solve it were most likely the genius type of users. Remember in high school or college when there would always be someone in class who stands out because of his extreme intelligence. Well, this is perhaps the type of person who solves the problem like problem 717.&lt;br /&gt;&lt;br /&gt;So one feel that he is confident to take on really challenging problems, and that most problems have become too easy already, and that he has had enough programming experience already so that he is no longer vulnerable to becoming frustrated whenever he is unable to solve difficult problems, then one must at all cost avoid this type of problems with high BR ratios but extremely low  B values.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Notice also that for problem 717, out of the 12 users who attempted it (U = 12), all of them were able to solve it (UR = 100%), confirming that these few people must indeed be geniuses.&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2271741171932159121-8709267942700836744?l=algoshare.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://algoshare.blogspot.com/feeds/8709267942700836744/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://algoshare.blogspot.com/2008/12/finding-easy-problems.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/8709267942700836744'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/8709267942700836744'/><link rel='alternate' type='text/html' href='http://algoshare.blogspot.com/2008/12/finding-easy-problems.html' title='Finding the easy problems'/><author><name>Algorithm Share</name><uri>http://www.blogger.com/profile/05122107953495341186</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_2PJwbgod-iA/SVnnLShKfEI/AAAAAAAAACU/BpeolwJgjjI/s72-c/pic1.GIF' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2271741171932159121.post-5700746703677303395</id><published>2008-12-29T21:14:00.000-08:00</published><updated>2008-12-29T21:15:35.947-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='UVA Online Judge'/><category scheme='http://www.blogger.com/atom/ns#' term='parking'/><category scheme='http://www.blogger.com/atom/ns#' term='distance'/><category scheme='http://www.blogger.com/atom/ns#' term='algorithm'/><category scheme='http://www.blogger.com/atom/ns#' term='11364'/><category scheme='http://www.blogger.com/atom/ns#' term='difference'/><title type='text'>UVa problem 11364: sample algorithm</title><content type='html'>To solve UVa problem 11364 (Parking), it would be beneficial to know that the minimal distance Michael has to walk is simply twice the distance from the farthest store to the nearest store. For example, consider the following setup:&lt;br /&gt;A________B______________C_____D&lt;br /&gt;X______________________________&lt;br /&gt;&lt;br /&gt;A, B, C and D are the stores while X is Michael’s car. To get to all the stores and return to his car, Michael would have to walk:&lt;br /&gt;&lt;br /&gt;A to B&lt;br /&gt;B to C&lt;br /&gt;C to D&lt;br /&gt;D to C&lt;br /&gt;C to B&lt;br /&gt;B to A&lt;br /&gt;&lt;br /&gt;In essense, the total distance he would have traveled would be just twice the distance from A to D.&lt;br /&gt;&lt;br /&gt;Consider now the following setup:&lt;br /&gt;&lt;br /&gt;A________B______________C_____D&lt;br /&gt;__________________X____________&lt;br /&gt;&lt;br /&gt;For Michael to get to all stores and return to his car, he would need to walk:&lt;br /&gt;&lt;br /&gt;X to B&lt;br /&gt;B to A&lt;br /&gt;A to B&lt;br /&gt;B to X&lt;br /&gt;X to C&lt;br /&gt;C to D&lt;br /&gt;D to C&lt;br /&gt;C to X&lt;br /&gt;&lt;br /&gt;Again, analyzing this series of walks, it is simply twice the distance from A to D.&lt;br /&gt;&lt;br /&gt;Hence to compute the minimal distance given a series of stores to walk to, simply find the nearest store and the farthest store, get their difference and then multiply the difference by 2.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2271741171932159121-5700746703677303395?l=algoshare.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://algoshare.blogspot.com/feeds/5700746703677303395/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://algoshare.blogspot.com/2008/12/uva-problem-11364-sample-algorithm.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/5700746703677303395'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/5700746703677303395'/><link rel='alternate' type='text/html' href='http://algoshare.blogspot.com/2008/12/uva-problem-11364-sample-algorithm.html' title='UVa problem 11364: sample algorithm'/><author><name>Algorithm Share</name><uri>http://www.blogger.com/profile/05122107953495341186</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2271741171932159121.post-1143226321339990965</id><published>2008-12-29T20:58:00.000-08:00</published><updated>2009-01-01T03:13:26.712-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='UVA Online Judge'/><category scheme='http://www.blogger.com/atom/ns#' term='parking'/><category scheme='http://www.blogger.com/atom/ns#' term='problem'/><category scheme='http://www.blogger.com/atom/ns#' term='sample solution'/><category scheme='http://www.blogger.com/atom/ns#' term='code'/><category scheme='http://www.blogger.com/atom/ns#' term='11364'/><title type='text'>UVa problem 11364: sample code</title><content type='html'>&lt;pre&gt;&lt;br /&gt;001 #include "stdio.h"&lt;br /&gt;002 #include "stdlib.h"&lt;br /&gt;003 &lt;br /&gt;004 int main() {&lt;br /&gt;005   char  line[100]&lt;br /&gt;006       , ctmp[100]&lt;br /&gt;007   ;&lt;br /&gt;008   int   num_tests&lt;br /&gt;009       , num_stores&lt;br /&gt;010       , stores[100]&lt;br /&gt;011       , itmp&lt;br /&gt;012       , max&lt;br /&gt;013       , min&lt;br /&gt;014       , diff&lt;br /&gt;015       , i&lt;br /&gt;016       , j&lt;br /&gt;017       , k&lt;br /&gt;018       , m&lt;br /&gt;019   ;&lt;br /&gt;020 &lt;br /&gt;021   fgets(line, 100, stdin);&lt;br /&gt;022   sscanf(line, "%d\n", &amp;num_tests);&lt;br /&gt;023 &lt;br /&gt;024   for (i = 0; i &lt; num_tests; i += 1) {&lt;br /&gt;025     fgets(line, 100, stdin);&lt;br /&gt;026     sscanf(line, "%d\n", &amp;num_stores);&lt;br /&gt;027 &lt;br /&gt;028     fgets(line, 100, stdin);&lt;br /&gt;029     for (j = 0, m = 0; 1; j += 1) {&lt;br /&gt;030       if (line[j] == '\n' || line[j] == 0) {&lt;br /&gt;031         break;&lt;br /&gt;032       }&lt;br /&gt;033 &lt;br /&gt;034       if (line[j] == ' ' || line[j] == '\t') {&lt;br /&gt;035         continue;&lt;br /&gt;036       }&lt;br /&gt;037 &lt;br /&gt;038       for (k = 0; 1 ; j += 1, k += 1) {&lt;br /&gt;039         if (line[j] == ' ' || line[j] == '\t' || line[j] == '\n' || line[j] == 0) {&lt;br /&gt;040           break;&lt;br /&gt;041         }&lt;br /&gt;042         ctmp[k] = line[j];&lt;br /&gt;043       }&lt;br /&gt;044       ctmp[k] = 0;&lt;br /&gt;045 &lt;br /&gt;046       stores[m] = atoi(ctmp);&lt;br /&gt;047       m += 1;&lt;br /&gt;048     }&lt;br /&gt;049     &lt;br /&gt;050     max = 0;&lt;br /&gt;051     min = 99;&lt;br /&gt;052     for (j = 0; j &lt; num_stores; j += 1) {&lt;br /&gt;053       if (stores[j] &gt; max) {&lt;br /&gt;054         max = stores[j];&lt;br /&gt;055       }&lt;br /&gt;056 &lt;br /&gt;057       if (stores[j] &lt; min) {&lt;br /&gt;058         min = stores[j];&lt;br /&gt;059       }&lt;br /&gt;060     }&lt;br /&gt;061     diff = max - min;&lt;br /&gt;062     diff *= 2;&lt;br /&gt;063 &lt;br /&gt;064     printf("%d\n", diff);&lt;br /&gt;065   }&lt;br /&gt;066 &lt;br /&gt;067   return 0;&lt;br /&gt;068 }&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2271741171932159121-1143226321339990965?l=algoshare.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://algoshare.blogspot.com/feeds/1143226321339990965/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://algoshare.blogspot.com/2008/12/uva-problem-11364-sample-code.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/1143226321339990965'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/1143226321339990965'/><link rel='alternate' type='text/html' href='http://algoshare.blogspot.com/2008/12/uva-problem-11364-sample-code.html' title='UVa problem 11364: sample code'/><author><name>Algorithm Share</name><uri>http://www.blogger.com/profile/05122107953495341186</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2271741171932159121.post-2141213285948380831</id><published>2008-12-29T19:57:00.000-08:00</published><updated>2008-12-29T20:57:11.742-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='10851'/><category scheme='http://www.blogger.com/atom/ns#' term='map'/><category scheme='http://www.blogger.com/atom/ns#' term='problem'/><category scheme='http://www.blogger.com/atom/ns#' term='algorithm'/><category scheme='http://www.blogger.com/atom/ns#' term='2D hieroglyphs decoder'/><category scheme='http://www.blogger.com/atom/ns#' term='bitwise AND'/><category scheme='http://www.blogger.com/atom/ns#' term='mod'/><category scheme='http://www.blogger.com/atom/ns#' term='right-shift'/><category scheme='http://www.blogger.com/atom/ns#' term='UVA Online Judge'/><category scheme='http://www.blogger.com/atom/ns#' term='division'/><category scheme='http://www.blogger.com/atom/ns#' term='solution'/><category scheme='http://www.blogger.com/atom/ns#' term='encryption'/><category scheme='http://www.blogger.com/atom/ns#' term='power of 2'/><title type='text'>UVa problem 10851: sample algorithm</title><content type='html'>&lt;p&gt;&lt;span style="font-family:verdana;"&gt;In UVa problem 10851 (2D Hieroglyphs decoder), one could explore the advantage of using right bit-shifts instead of long-cut division for division by powers of 2. For example, to divide a number by 128 (which is 2 raised to the power of 7), one could simply shift the number 7 bits to the right.&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;Definitely, this fact could give one an advantage as a bit-shift operation is so much simpler and faster than traditional division.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:verdana;"&gt;Moreover, the mod operation may be quite computationally expensive as well. Since a mod by 2 operation is only needed, one could simply check whether the last binary bit of a number is 0 or 1 in order to tell if the number is divisible by 2 or not.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:verdana;"&gt;For example, the number 15 when represented in binary is 1111. Since its last bit (the right-most) is 1, then it is not divisible by 2. The number 12 when represented in binary is 1100. Since the last bit is 0, then it is divisible by 2. Bitwise-ANDing the number with 1 will enable one to get the last bit of the number.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:verdana;"&gt;For this problem, one could build a lookup table for each of the 256 ASCII characters. One could explore the use of a C++ standard map, where the key is the encrypted character and the value is the actual ASCII character. For example, we could build a map like the following:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-family:courier new;"&gt;Key, Value&lt;br /&gt;//\\//\/, L&lt;br /&gt;\/////\/, A&lt;br /&gt;…&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:verdana;"&gt;And so when our program sees an encryption of &lt;span style="font-family:courier new;"&gt;//\\//\/&lt;/span&gt;, it can simply lookup the map and find that the encryption stands for the ASCII character L.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2271741171932159121-2141213285948380831?l=algoshare.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://algoshare.blogspot.com/feeds/2141213285948380831/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://algoshare.blogspot.com/2008/12/uva-problem-10851-sample-algorithm.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/2141213285948380831'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/2141213285948380831'/><link rel='alternate' type='text/html' href='http://algoshare.blogspot.com/2008/12/uva-problem-10851-sample-algorithm.html' title='UVa problem 10851: sample algorithm'/><author><name>Algorithm Share</name><uri>http://www.blogger.com/profile/05122107953495341186</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2271741171932159121.post-8833746676859298916</id><published>2008-12-29T19:14:00.000-08:00</published><updated>2009-01-01T03:07:41.741-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='UVA Online Judge'/><category scheme='http://www.blogger.com/atom/ns#' term='10851'/><category scheme='http://www.blogger.com/atom/ns#' term='problem'/><category scheme='http://www.blogger.com/atom/ns#' term='computer programming'/><category scheme='http://www.blogger.com/atom/ns#' term='solution'/><category scheme='http://www.blogger.com/atom/ns#' term='algorithm'/><category scheme='http://www.blogger.com/atom/ns#' term='2D hieroglyphs decoder'/><title type='text'>UVa problem 10851: sample code</title><content type='html'>&lt;pre&gt;&lt;br /&gt;001 #include "stdio.h"&lt;br /&gt;002 #include "string"&lt;br /&gt;003 #include "map"&lt;br /&gt;004 #include "iostream"&lt;br /&gt;005 &lt;br /&gt;006 using namespace std;&lt;br /&gt;007 &lt;br /&gt;008 int main() {&lt;br /&gt;009   char   line[100]&lt;br /&gt;010        , ctmp[100]&lt;br /&gt;011        , dtmp[100]&lt;br /&gt;012        , input[10][100]&lt;br /&gt;013        ;&lt;br /&gt;014   int   num_msg&lt;br /&gt;015       , i&lt;br /&gt;016       , ii&lt;br /&gt;017       , j&lt;br /&gt;018       , k&lt;br /&gt;019       , b&lt;br /&gt;020       , c&lt;br /&gt;021       , m&lt;br /&gt;022       , n&lt;br /&gt;023       , p&lt;br /&gt;024       , msg_len;&lt;br /&gt;025       ;&lt;br /&gt;026 &lt;br /&gt;027   map&lt;string, int&gt; imap;&lt;br /&gt;028   map&lt;string, int&gt;::iterator iter;&lt;br /&gt;029 &lt;br /&gt;030   for (c = 0; c &lt; 256; c += 1) {&lt;br /&gt;031     ctmp[0] = '/';&lt;br /&gt;032     ctmp[9] = '/';&lt;br /&gt;033 &lt;br /&gt;034     for (i = 1; i &lt; 9; i += 1) {&lt;br /&gt;035       ii = i - 1;&lt;br /&gt;036 &lt;br /&gt;037       b = c &gt;&gt; ii;&lt;br /&gt;038       b &amp;= 1;&lt;br /&gt;039 &lt;br /&gt;040       ctmp[i] = b == 0 ? '/' : '\\';&lt;br /&gt;041     }&lt;br /&gt;042 &lt;br /&gt;043     ctmp[10] = 0;&lt;br /&gt;044 &lt;br /&gt;045     imap.insert(pair&lt;string, int&gt;(ctmp, c));&lt;br /&gt;046   }&lt;br /&gt;047 &lt;br /&gt;048   fgets(line, 100, stdin);&lt;br /&gt;049   sscanf(line, "%d\n", &amp;num_msg);&lt;br /&gt;050 &lt;br /&gt;051   for (i = 0; i &lt; num_msg; ++i) {&lt;br /&gt;052     for (j = 0; j &lt; 10; ++j) {&lt;br /&gt;053       fgets(line, 100, stdin);&lt;br /&gt;054       sscanf(line, "%s\n", &amp;input[j]);&lt;br /&gt;055     }&lt;br /&gt;056 &lt;br /&gt;057     fgets(line, 100, stdin);&lt;br /&gt;058 &lt;br /&gt;059     msg_len = strlen(input[0]) - 2;&lt;br /&gt;060 &lt;br /&gt;061     for (m = 1, p = 0; m &lt;= msg_len; m += 1, p += 1) {&lt;br /&gt;062       for (n = 0; n &lt; 10; n += 1) {&lt;br /&gt;063         ctmp[n] = input[n][m];&lt;br /&gt;064       }&lt;br /&gt;065       ctmp[n] = 0;&lt;br /&gt;066 &lt;br /&gt;067       iter = imap.find(ctmp);&lt;br /&gt;068       dtmp[p] = iter-&gt;second;&lt;br /&gt;069     }&lt;br /&gt;070     dtmp[p] = 0;&lt;br /&gt;071 &lt;br /&gt;072     printf("%s\n", dtmp);&lt;br /&gt;073   }&lt;br /&gt;074 &lt;br /&gt;075   return 0;&lt;br /&gt;076 }&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2271741171932159121-8833746676859298916?l=algoshare.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://algoshare.blogspot.com/feeds/8833746676859298916/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://algoshare.blogspot.com/2008/12/uva-problem-10851.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/8833746676859298916'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/8833746676859298916'/><link rel='alternate' type='text/html' href='http://algoshare.blogspot.com/2008/12/uva-problem-10851.html' title='UVa problem 10851: sample code'/><author><name>Algorithm Share</name><uri>http://www.blogger.com/profile/05122107953495341186</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2271741171932159121.post-4211474993169331739</id><published>2008-12-29T03:36:00.001-08:00</published><updated>2009-01-01T03:18:25.374-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='standard input'/><category scheme='http://www.blogger.com/atom/ns#' term='file'/><category scheme='http://www.blogger.com/atom/ns#' term='getting input'/><category scheme='http://www.blogger.com/atom/ns#' term='programming competitions'/><title type='text'>Getting input</title><content type='html'>&lt;p class="MsoNoSpacing"&gt;For programming competitions, input will usually come from standard input; that is, input is taken from the user manually typing the input, or input is directed into the program from a file.&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;?xml:namespace prefix = o /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;When input is manually typed by the user, it will be like Figure 1.&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_2PJwbgod-iA/SVi26nvs4OI/AAAAAAAAAB8/jaF6o2TKzhg/s1600-h/pic1.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5285175280937001186" style="WIDTH: 400px; CURSOR: pointer; HEIGHT: 202px" alt="" src="http://1.bp.blogspot.com/_2PJwbgod-iA/SVi26nvs4OI/AAAAAAAAAB8/jaF6o2TKzhg/s400/pic1.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;meta content="text/html; charset=utf-8" equiv="Content-Type"&gt;&lt;meta content="Word.Document" name="ProgId"&gt;&lt;meta content="Microsoft Word 12" name="Generator"&gt;&lt;meta content="Microsoft Word 12" name="Originator"&gt;&lt;link href="file:///C:%5CDOCUME%7E1%5Cyukur%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml" rel="File-List"&gt;&lt;link href="file:///C:%5CDOCUME%7E1%5Cyukur%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx" rel="themeData"&gt;&lt;link href="file:///C:%5CDOCUME%7E1%5Cyukur%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml" rel="colorSchemeMapping"&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:SimSun; 	panose-1:2 1 6 0 3 1 1 1 1 1; 	mso-font-alt:宋体; 	mso-font-charset:134; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:3 135135232 16 0 262145 0;} @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:1; 	mso-generic-font-family:roman; 	mso-font-format:other; 	mso-font-pitch:variable; 	mso-font-signature:0 0 0 0 0 0;} @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1073750139 0 0 159 0;} @font-face 	{font-family:"\@SimSun"; 	panose-1:2 1 6 0 3 1 1 1 1 1; 	mso-font-charset:134; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:3 135135232 16 0 262145 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin-top:0in; 	margin-right:0in; 	margin-bottom:10.0pt; 	margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:SimSun; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} p.MsoNoSpacing, li.MsoNoSpacing, div.MsoNoSpacing 	{mso-style-priority:1; 	mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:SimSun; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:SimSun; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoPapDefault 	{mso-style-type:export-only; 	margin-bottom:10.0pt; 	line-height:115%;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.0in 1.0in 1.0in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;br /&gt;&lt;p class="MsoNoSpacing"&gt;Figure 1. Input manually typed by the user.&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;In Figure 1, the user manually types the input “User is typing this line now.”&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;When input is directed into the program from a file, it would appear like Figure 2.&lt;/p&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_2PJwbgod-iA/SVi23OCU2XI/AAAAAAAAAB0/3iqdrgNwhoI/s1600-h/pic2.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5285175222496188786" style="WIDTH: 400px; CURSOR: pointer; HEIGHT: 202px" alt="" src="http://3.bp.blogspot.com/_2PJwbgod-iA/SVi23OCU2XI/AAAAAAAAAB0/3iqdrgNwhoI/s400/pic2.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;meta content="text/html; charset=utf-8" equiv="Content-Type"&gt;&lt;meta content="Word.Document" name="ProgId"&gt;&lt;meta content="Microsoft Word 12" name="Generator"&gt;&lt;meta content="Microsoft Word 12" name="Originator"&gt;&lt;link href="file:///C:%5CDOCUME%7E1%5Cyukur%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml" rel="File-List"&gt;&lt;link href="file:///C:%5CDOCUME%7E1%5Cyukur%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx" rel="themeData"&gt;&lt;link href="file:///C:%5CDOCUME%7E1%5Cyukur%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml" rel="colorSchemeMapping"&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:SimSun; 	panose-1:2 1 6 0 3 1 1 1 1 1; 	mso-font-alt:宋体; 	mso-font-charset:134; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:3 135135232 16 0 262145 0;} @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:1; 	mso-generic-font-family:roman; 	mso-font-format:other; 	mso-font-pitch:variable; 	mso-font-signature:0 0 0 0 0 0;} @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1073750139 0 0 159 0;} @font-face 	{font-family:"\@SimSun"; 	panose-1:2 1 6 0 3 1 1 1 1 1; 	mso-font-charset:134; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:3 135135232 16 0 262145 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin-top:0in; 	margin-right:0in; 	margin-bottom:10.0pt; 	margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:SimSun; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} p.MsoNoSpacing, li.MsoNoSpacing, div.MsoNoSpacing 	{mso-style-priority:1; 	mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:SimSun; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:SimSun; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoPapDefault 	{mso-style-type:export-only; 	margin-bottom:10.0pt; 	line-height:115%;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.0in 1.0in 1.0in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;br /&gt;&lt;p class="MsoNoSpacing"&gt;Figure 2. Input directed from a file.&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;In Figure 2, the contents of the file i.txt are inputted into the program.&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;Reading a line from standard input can be done using Code 1.&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="COLOR: rgb(0,0,0)"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="COLOR: rgb(0,0,0)"&gt;Code 1. Reading a line from standard input.&lt;/p&gt;&lt;p class="MsoNoSpacing" style="COLOR: rgb(0,0,0)"&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="color:#993399;"&gt;#include "stdio.h"&lt;stdio.h&gt;&lt;/STDIO.H&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;&lt;p class="MsoNoSpacing" style="COLOR: rgb(153,51,153); FONT-FAMILY: courier new"&gt;&lt;o:p&gt;&lt;span style="color:#ff99ff;"&gt;&lt;/span&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="COLOR: rgb(153,51,153); FONT-FAMILY: courier new"&gt;int main() {&lt;/p&gt;&lt;p class="MsoNoSpacing" style="COLOR: rgb(153,51,153); FONT-FAMILY: courier new"&gt;__char line[100];&lt;/p&gt;&lt;p class="MsoNoSpacing" style="COLOR: rgb(153,51,153); FONT-FAMILY: courier new"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="COLOR: rgb(153,51,153); FONT-FAMILY: courier new"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="COLOR: rgb(153,51,153); FONT-FAMILY: courier new"&gt;__fgets(line, 100, stdin);&lt;/p&gt;&lt;p class="MsoNoSpacing" style="COLOR: rgb(153,51,153)" face="courier new"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="COLOR: rgb(153,51,153); FONT-FAMILY: courier new"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="COLOR: rgb(153,51,153); FONT-FAMILY: courier newfont-family:courier new"&gt;__return 0;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="COLOR: rgb(153,51,153)" face="courier new"&gt;}&lt;/p&gt;&lt;p class="MsoNoSpacing" style="FONT-FAMILY: courier new"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;/p&gt;&lt;/pre&gt;&lt;p&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;br /&gt;In Code 1, the fgets statement is configured to read from standard input using the stdin parameter. The line read is then placed into the character array line. The parameter 100 is used to indicate the maximum number of characters to be read. We use 100 since we declared the line variable to be a character array of 100 slots.&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;In Code 1, once the fgets statement is executed, the user can pretty much do anything with the line variable which contains the line read from standard input. For example, the user can print the contents into standard output such as the code in Code 2.&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;Code 2. Printing what was read from standard input.&lt;/p&gt;&lt;p class="MsoNoSpacing" style="COLOR: rgb(153,51,153); FONT-FAMILY: courier new"&gt;#include "stdio.h"&lt;/p&gt;&lt;p class="MsoNoSpacing" style="COLOR: rgb(153,51,153); FONT-FAMILY: courier new"&gt;&lt;br /&gt;&lt;stdio.h&gt;&lt;/STDIO.H&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="COLOR: rgb(153,51,153); FONT-FAMILY: courier newfont-family:courier new"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="COLOR: rgb(153,51,153)" face="courier new"&gt;int main() {&lt;/p&gt;&lt;p class="MsoNoSpacing" style="COLOR: rgb(153,51,153); FONT-FAMILY: courier newfont-family:courier new;" &gt;&lt;span style="font-size:0;"&gt;__&lt;/span&gt;char line[100];&lt;/p&gt;&lt;p class="MsoNoSpacing" style="COLOR: rgb(153,51,153); FONT-FAMILY: courier new" face="courier new"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="COLOR: rgb(153,51,153); FONT-FAMILY: courier new" face="courier new"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="COLOR: rgb(153,51,153); FONT-FAMILY: courier new" face="courier new"&gt;__fgets(line, 100, stdin);&lt;/p&gt;&lt;p class="MsoNoSpacing" style="COLOR: rgb(153,51,153); FONT-FAMILY: courier new"&gt;__printf("User typed the following: %s\n" , line);&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="COLOR: rgb(153,51,153); FONT-FAMILY: courier new"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="COLOR: rgb(153,51,153); FONT-FAMILY: courier new"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="COLOR: rgb(153,51,153); FONT-FAMILY: courier new"&gt;__return 0;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="COLOR: rgb(153,51,153); FONT-FAMILY: courier new"&gt;}&lt;/p&gt;&lt;p class="MsoNoSpacing" style="FONT-FAMILY: courier new"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;When Code 2 is executed, it behaves like Figure 3.&lt;/p&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_2PJwbgod-iA/SVi2v8vcApI/AAAAAAAAABs/cMaKxjVRjLI/s1600-h/pic3.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5285175097594479250" style="WIDTH: 400px; CURSOR: pointer; HEIGHT: 202px" alt="" src="http://2.bp.blogspot.com/_2PJwbgod-iA/SVi2v8vcApI/AAAAAAAAABs/cMaKxjVRjLI/s400/pic3.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;link style="FONT-FAMILY: arial" href="file:///C:%5CDOCUME%7E1%5Cyukur%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml" rel="File-List"&gt;&lt;link style="FONT-FAMILY: arial" href="file:///C:%5CDOCUME%7E1%5Cyukur%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx" rel="themeData"&gt;&lt;link style="FONT-FAMILY: arial" href="file:///C:%5CDOCUME%7E1%5Cyukur%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml" rel="colorSchemeMapping"&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:SimSun; 	panose-1:2 1 6 0 3 1 1 1 1 1; 	mso-font-alt:宋体; 	mso-font-charset:134; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:3 135135232 16 0 262145 0;} @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:1; 	mso-generic-font-family:roman; 	mso-font-format:other; 	mso-font-pitch:variable; 	mso-font-signature:0 0 0 0 0 0;} @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1073750139 0 0 159 0;} @font-face 	{font-family:"\@SimSun"; 	panose-1:2 1 6 0 3 1 1 1 1 1; 	mso-font-charset:134; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:3 135135232 16 0 262145 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin-top:0in; 	margin-right:0in; 	margin-bottom:10.0pt; 	margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:SimSun; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:SimSun; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoPapDefault 	{mso-style-type:export-only; 	margin-bottom:10.0pt; 	line-height:115%;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.0in 1.0in 1.0in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;span style="LINE-HEIGHT: 115%;font-family:';font-size:100%;"  &gt;Figure 3. Sample execution of Code 2.&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_2PJwbgod-iA/SVi2bwSBMOI/AAAAAAAAABk/IZyzYQtN-sc/s1600-h/pic1.JPG"&gt;&lt;meta content="text/html; charset=utf-8" equiv="Content-Type"&gt;&lt;meta content="Word.Document" name="ProgId"&gt;&lt;meta content="Microsoft Word 12" name="Generator"&gt;&lt;meta content="Microsoft Word 12" name="Originator"&gt;&lt;link href="file:///C:%5CDOCUME%7E1%5Cyukur%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml" rel="File-List"&gt;&lt;link href="file:///C:%5CDOCUME%7E1%5Cyukur%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx" rel="themeData"&gt;&lt;link href="file:///C:%5CDOCUME%7E1%5Cyukur%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml" rel="colorSchemeMapping"&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:SimSun; 	panose-1:2 1 6 0 3 1 1 1 1 1; 	mso-font-alt:宋体; 	mso-font-charset:134; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:3 135135232 16 0 262145 0;} @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:1; 	mso-generic-font-family:roman; 	mso-font-format:other; 	mso-font-pitch:variable; 	mso-font-signature:0 0 0 0 0 0;} @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1073750139 0 0 159 0;} @font-face 	{font-family:"\@SimSun"; 	panose-1:2 1 6 0 3 1 1 1 1 1; 	mso-font-charset:134; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:3 135135232 16 0 262145 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin-top:0in; 	margin-right:0in; 	margin-bottom:10.0pt; 	margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:SimSun; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} p.MsoNoSpacing, li.MsoNoSpacing, div.MsoNoSpacing 	{mso-style-priority:1; 	mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:SimSun; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:SimSun; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoPapDefault 	{mso-style-type:export-only; 	margin-bottom:10.0pt; 	line-height:115%;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.0in 1.0in 1.0in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2271741171932159121-4211474993169331739?l=algoshare.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://algoshare.blogspot.com/feeds/4211474993169331739/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://algoshare.blogspot.com/2008/12/getting-input.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/4211474993169331739'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/4211474993169331739'/><link rel='alternate' type='text/html' href='http://algoshare.blogspot.com/2008/12/getting-input.html' title='Getting input'/><author><name>Algorithm Share</name><uri>http://www.blogger.com/profile/05122107953495341186</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_2PJwbgod-iA/SVi26nvs4OI/AAAAAAAAAB8/jaF6o2TKzhg/s72-c/pic1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2271741171932159121.post-4070509404907585943</id><published>2008-12-28T21:56:00.001-08:00</published><updated>2008-12-28T22:21:46.302-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ci-tech'/><category scheme='http://www.blogger.com/atom/ns#' term='Dev-C++'/><category scheme='http://www.blogger.com/atom/ns#' term='Noel Patron'/><category scheme='http://www.blogger.com/atom/ns#' term='Canon Information Technologies Philippines'/><category scheme='http://www.blogger.com/atom/ns#' term='Edward Bernardo'/><category scheme='http://www.blogger.com/atom/ns#' term='compiler'/><category scheme='http://www.blogger.com/atom/ns#' term='Ateneo de Manila University'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><category scheme='http://www.blogger.com/atom/ns#' term='programming competitions'/><category scheme='http://www.blogger.com/atom/ns#' term='language'/><category scheme='http://www.blogger.com/atom/ns#' term='compiling'/><title type='text'>Dev-C++</title><content type='html'>Most of the algorithms I will be discussing will be based on how I will implement them in the C/C++ language. Although algorithms should be purely independent of the programming language used, I often think of the algorithms in terms of the underlying language I would be using to implement them.&lt;br /&gt;&lt;br /&gt;In this post, I will be discussing the tool used for compiling the C/C++ codes I create to test my algorithms. Although everyone has his own way of compiling – like others may use g++ or Visual C++ – others may have no idea on how to compile. This post is dedicated to those others who have no idea or are confused on how to compile their codes. I present my way of compiling.&lt;br /&gt;&lt;br /&gt;To compile my C/C++ codes, I use the tool Dev-C++. You can use Google to search for it. It’s a tool my college instructor, Noel Patron from the Ateneo de Manila University, taught me. I thought I would only use it in college, but when I started working as an employee, I was also using it in the company’s regular programming competitions.&lt;br /&gt;&lt;br /&gt;My company back then was Canon Information Technologies Philippines, Inc. The company would host quarterly programming competitions. Cash rewards were awarded to winners. I won a couple of contests but I do not consider myself to be a top programmer. The contests in Canon were almost always created by a certain Edward Bernardo, the chief software architect.&lt;br /&gt;&lt;br /&gt;So I thought that after college, that would be the end of my using the Dev-C++ tool. But joining the programming competitions in Canon (also called ci-tech (pronounced as “see-I-tek”)) forced me to use the tool again. It was actually the software architect Edward Bernardo who coerced all programming contest participants to use the tool, so I had no choice but to use it again.&lt;br /&gt;&lt;br /&gt;Interestingly, several years since I last used the tool in college, the tool had not changed much. Somehow, someway or another, people just stopped developing the tool, and so no new updates or versions of the tool were released since I last used it in college. And that was several years ago.&lt;br /&gt;&lt;br /&gt;Somehow also, it is the only Windows C++ compiler I know how to use until this date. In college, I used to use Borland C++ or Microsoft Visual C++. But somehow, these other tools lost popularity. Borland C++ definitely lost popularity as I don’t hear anybody using it anymore, at least in my neighborhood. Microsoft Visual C++ definitely is ultra popular, but how in the world do you get the software for free. Microsoft keeps collecting money from us, until we third world developers have nothing left to use to develop our ideas and algorithms.&lt;br /&gt;&lt;br /&gt;So, I was left with Dev-C++, until now, and who knows, maybe until I’m real old and shriveled like a rotten tomato, still aspiring to be a decent programmer.&lt;br /&gt;&lt;br /&gt;Now, going back to the real topic. The Dev-C++ website is kind of confusing. I always got lost in it back in college when I had to download the binary and install it into a workstation. In my days, we had no personal laptops and so we had to hop from one computer to another, and install the bloody tool every time we saw that the workstation we hopped into did not have the tool installed into it.&lt;br /&gt;&lt;br /&gt;To download the tool, go to the following website:&lt;br /&gt;&lt;a href="http://www.bloodshed.net/devcpp.html"&gt;http://www.bloodshed.net/devcpp.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Figure 1 shows a screenshot of the site.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_2PJwbgod-iA/SVhm1QRmlwI/AAAAAAAAAA8/Bl2J7vaOkys/s1600-h/pic1.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5285087227807176450" style="WIDTH: 400px; CURSOR: hand; HEIGHT: 370px" alt="" src="http://2.bp.blogspot.com/_2PJwbgod-iA/SVhm1QRmlwI/AAAAAAAAAA8/Bl2J7vaOkys/s400/pic1.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;Figure 1. Screenshot of the Dev-C++ website.&lt;br /&gt;&lt;br /&gt;Click onto the download page, download the binary and install it. By the way, Dev-C++ is for Windows.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;Once installed, you can immediately use it. Figure 2 shows a screenshot of the Dev-C++ tool.&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://2.bp.blogspot.com/_2PJwbgod-iA/SVhmxTjacTI/AAAAAAAAAA0/eNArGp1H23w/s1600-h/pic2.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5285087159967707442" style="WIDTH: 400px; CURSOR: hand; HEIGHT: 313px" alt="" src="http://2.bp.blogspot.com/_2PJwbgod-iA/SVhmxTjacTI/AAAAAAAAAA0/eNArGp1H23w/s400/pic2.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 2. Screenshot of the Dev-C++ tool.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;Through the tool, you type in your code, save it and then compile (CTRL-F9). Should there be no compile errors, you can close the dialog box shown in Figure 2. Open a command prompt and run the executable as shown in Figure 3. &lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://2.bp.blogspot.com/_2PJwbgod-iA/SVhmshwlm9I/AAAAAAAAAAs/55wfupH5CHY/s1600-h/pic3.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5285087077881715666" style="WIDTH: 400px; CURSOR: hand; HEIGHT: 202px" alt="" src="http://2.bp.blogspot.com/_2PJwbgod-iA/SVhmshwlm9I/AAAAAAAAAAs/55wfupH5CHY/s400/pic3.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 3. Executing the executable.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;In Figure 3, go to the directory where you saved your code. More often than not, the executable will be the same name as the file name of your code except for the suffix extension. For example, if you named your code a.cpp, then most likely, an executable named a.exe will be created if your compilation yielded no errors. Simply type the name of the executable to execute.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2271741171932159121-4070509404907585943?l=algoshare.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://algoshare.blogspot.com/feeds/4070509404907585943/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://algoshare.blogspot.com/2008/12/dev-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/4070509404907585943'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/4070509404907585943'/><link rel='alternate' type='text/html' href='http://algoshare.blogspot.com/2008/12/dev-c.html' title='Dev-C++'/><author><name>Algorithm Share</name><uri>http://www.blogger.com/profile/05122107953495341186</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_2PJwbgod-iA/SVhm1QRmlwI/AAAAAAAAAA8/Bl2J7vaOkys/s72-c/pic1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2271741171932159121.post-6014271635284156039</id><published>2008-12-28T20:31:00.000-08:00</published><updated>2008-12-28T21:05:04.400-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='programming competition'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='problem'/><category scheme='http://www.blogger.com/atom/ns#' term='UVA Online Judge'/><category scheme='http://www.blogger.com/atom/ns#' term='Google search bar'/><category scheme='http://www.blogger.com/atom/ns#' term='algorithms'/><category scheme='http://www.blogger.com/atom/ns#' term='computer programming'/><category scheme='http://www.blogger.com/atom/ns#' term='archive'/><category scheme='http://www.blogger.com/atom/ns#' term='code'/><category scheme='http://www.blogger.com/atom/ns#' term='online submission'/><category scheme='http://www.blogger.com/atom/ns#' term='Pascal'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><category scheme='http://www.blogger.com/atom/ns#' term='validation'/><title type='text'>UVa Online Judge</title><content type='html'>The UVa Online Judge (&lt;a href="http://icpcres.ecs.baylor.edu/onlinejudge/"&gt;http://icpcres.ecs.baylor.edu/onlinejudge/&lt;/a&gt;) is a website that archives thousands of problems used for computer programming competitions. It also provides a facility for validating code submissions to the problems published. Hence, it offers an excellent venue for testing algorithms.&lt;br /&gt;&lt;br /&gt;Each problem in the archive is tagged with an ID number for easy identification. Refer to Figure 1.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_2PJwbgod-iA/SVhZKC9lcWI/AAAAAAAAAAc/KoVQU1g1S_o/s1600-h/pic1.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5285072191848018274" style="WIDTH: 400px; CURSOR: hand; HEIGHT: 108px" alt="" src="http://4.bp.blogspot.com/_2PJwbgod-iA/SVhZKC9lcWI/AAAAAAAAAAc/KoVQU1g1S_o/s400/pic1.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 1. Problems listing in the archive.&lt;br /&gt;&lt;br /&gt;In Figure 1, the problem “Moscow time” has an ID number of 505.&lt;br /&gt;&lt;br /&gt;Codes can be submitted for online validation can be written in C, Java, C++ or Pascal. Figure 2 shows the form for online submission.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;a href="http://3.bp.blogspot.com/_2PJwbgod-iA/SVhZGPhov2I/AAAAAAAAAAU/qDFeSoaik3U/s1600-h/pic2.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5285072126500978530" style="WIDTH: 400px; CURSOR: hand; HEIGHT: 163px" alt="" src="http://3.bp.blogspot.com/_2PJwbgod-iA/SVhZGPhov2I/AAAAAAAAAAU/qDFeSoaik3U/s400/pic2.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 2. Form for online code submission.&lt;br /&gt;&lt;br /&gt;To search for a problem, one can opt to use the Google search bar as shown in Figure 3.&lt;br /&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;&lt;a href="http://1.bp.blogspot.com/_2PJwbgod-iA/SVhY_aZZcFI/AAAAAAAAAAM/on-aYMbpF2M/s1600-h/pic3.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5285072009160126546" style="WIDTH: 320px; CURSOR: hand; HEIGHT: 185px" alt="" src="http://1.bp.blogspot.com/_2PJwbgod-iA/SVhY_aZZcFI/AAAAAAAAAAM/on-aYMbpF2M/s320/pic3.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 3. Google bar for searching problems.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Simply type in the problem ID in the Google bar. Be sure to tick the icpcres.ecs.baylor.edu button. &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2271741171932159121-6014271635284156039?l=algoshare.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://algoshare.blogspot.com/feeds/6014271635284156039/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://algoshare.blogspot.com/2008/12/uva-online-judge.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/6014271635284156039'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/6014271635284156039'/><link rel='alternate' type='text/html' href='http://algoshare.blogspot.com/2008/12/uva-online-judge.html' title='UVa Online Judge'/><author><name>Algorithm Share</name><uri>http://www.blogger.com/profile/05122107953495341186</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_2PJwbgod-iA/SVhZKC9lcWI/AAAAAAAAAAc/KoVQU1g1S_o/s72-c/pic1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2271741171932159121.post-4957796579873945728</id><published>2008-12-28T19:21:00.000-08:00</published><updated>2008-12-29T20:52:35.028-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='UVA Online Judge'/><category scheme='http://www.blogger.com/atom/ns#' term='programming competition'/><category scheme='http://www.blogger.com/atom/ns#' term='algorithms'/><category scheme='http://www.blogger.com/atom/ns#' term='programming contests'/><category scheme='http://www.blogger.com/atom/ns#' term='computer programming'/><category scheme='http://www.blogger.com/atom/ns#' term='computer algorithms'/><category scheme='http://www.blogger.com/atom/ns#' term='programming algorithms'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='programming tips'/><title type='text'>Welcome!</title><content type='html'>Welcome to Algorithm Share!&lt;br /&gt;&lt;br /&gt;This blog is about sharing algorithms with others.&lt;br /&gt;&lt;br /&gt;As for now, most of the problems to which algorithms will be discussed will come from the UVa Online Judge: &lt;a href="http://icpcres.ecs.baylor.edu/onlinejudge/"&gt;http://icpcres.ecs.baylor.edu/onlinejudge/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I encourage you to post comments if you have algorithms to share as well. Most of the algorithms I will share will be my own ideas, but I believe that there are a thousand more algorithms out there that are more optimized than my own for a given problem. So, please do share your algorithms for me to learn as well.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2271741171932159121-4957796579873945728?l=algoshare.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://algoshare.blogspot.com/feeds/4957796579873945728/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://algoshare.blogspot.com/2008/12/welcome.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/4957796579873945728'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2271741171932159121/posts/default/4957796579873945728'/><link rel='alternate' type='text/html' href='http://algoshare.blogspot.com/2008/12/welcome.html' title='Welcome!'/><author><name>Algorithm Share</name><uri>http://www.blogger.com/profile/05122107953495341186</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
