<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>돌이 코딩하는 방</title>
    <link>https://stonejjun.tistory.com/</link>
    <description>잡다한 이야기를 하는 블로그</description>
    <language>ko</language>
    <pubDate>Sun, 14 Jun 2026 03:44:54 +0900</pubDate>
    <generator>TISTORY</generator>
    <ttl>100</ttl>
    <managingEditor>stonejjun</managingEditor>
    <image>
      <title>돌이 코딩하는 방</title>
      <url>https://tistory1.daumcdn.net/tistory/3106892/attach/cb3bb57365ac4ab5a0d26d26e140202c</url>
      <link>https://stonejjun.tistory.com</link>
    </image>
    <item>
      <title>2025 ICPC APAC 참가 후기</title>
      <link>https://stonejjun.tistory.com/220</link>
      <description>&lt;p data-ke-size=&quot;size16&quot;&gt;이미 결말이 어느정도 알려진 스토리지만, 또 전지적 주인공 시점에서의 이야기는 또 다르니 한번 후기를 작성하려고 한다. 벌써 키보드를 두드리는 소리가 경쾌하다.&amp;nbsp;&lt;/p&gt;&lt;h3 data-ke-size=&quot;size23&quot;&gt;0. Prologue&amp;nbsp; &amp;nbsp;&lt;/h3&gt;&lt;p data-ke-size=&quot;size16&quot;&gt;다시 소개를 하자면 저희의 팀명은 DolAndDool 이며 팀원은 gs25, stonejjun03, yijw0930 이다. 우리팀의 포지션은 yijw가 자료구조와 역겨운 구현들을 맡고, 본인이 아이디어 및 관찰을 맡으며, gs25가 관찰, 수학 및 서포팅을 맡는다. &lt;br&gt;팀연습을 통해서&amp;nbsp; yijw-gs25 조합이 수학 문제 해결이나 gs가 툭 던져 yijw가 구현으로 마무리 하는 호흡을 보여주었으며, 특히 stonejjun-gs25 조합이 관찰을 엮거나 툭 발전시키기, 풀이의 큰 틀 잡는 감은 훌륭하지만 풀이의 완성도가 떨어지고 증명이 약한 stonejjun과 꼼꼼한 증명하기, 관찰 툭 던지기, 반례 찾기에 강점이 있는 gs25가 만나서 굉장한 시너지를 내는 경우가 많이 보였다. gs25가 정말 많은 노력으로 실력이 가파르게 상승해 팀의 훌륭한 마지막 퍼즐조각이 되어주고 있었다.&lt;br&gt;나는 다양한 이슈로 개인 연습을 별로 못했지만, yijw는 나름 꾸준히 연습한 것으로 보이며, gs25는 굉장히 열심히 달려왔다. 심지어 시간도 거의 맞지 않아, 방학동안 3번 남짓의 팀연습을 하게 되었는데, 사실 팀연습을 별로 하지 않을 계획이긴 했으나, 예상보다 너무 적게 하게 되었다.&amp;nbsp;&lt;br&gt;그래도 다행이 대회 직전 팀연습에서 꽤나 괜찮은 결과를 내었으며, WF 진출의 꿈을 안고 싱가포르로 향하게 된다.&lt;br&gt;&amp;nbsp;&lt;/p&gt;&lt;h3 data-ke-size=&quot;size23&quot;&gt;1.&amp;nbsp; from D-2 to D-1&lt;/h3&gt;&lt;p data-ke-size=&quot;size16&quot;&gt;가는 비행기에서는 겨울왕국 2를 2번 보며&amp;nbsp; 좋아하는 노래 중 하나인 show yourself를 마음에 새겼다. 도착해서는 gs25의 강력한 추천과 함께 칠리크랩을 먹었으며, 꽤나 맛있게 먹고 잠에 들었다.&lt;br&gt;대회 전날, 우리 팀은 아직 팀노트를 뽑지 못했다는 사실에 불안에 떨었다. 다행이도 USB를 통해 뽑을 수 있다는 대답을 들었다. 오프닝 세레머니와 함께 맛있는 점심을 먹고, 사전 연습 세션에 참여했다. 먼저 팀 대표 사진을 찍고, 문제 풀이에 들어갔다. 내가 S1 대신 S를 쓰거나, 복붙을 했다가 틀리거나 하는 등의 이슈가 있었지만 덕분에 인터렉티브의 세팅과 활용, 파일의 -를 복사하면 깨진다는 사실 등을 알아낸 유익한 시간이었다.&amp;nbsp;&amp;nbsp;&lt;br&gt;이후 친목 세션이 있었는데 많은 사람들과 이야기 해보고 싶었지만, 언어의 장벽과 자신감으로 인해 쉽게 입을 열지 못했다. 체스는 다 까먹어서 Scotch-Gambit Forgotten variation 을 사용하여 모두를 웃겼다. 저녁은 엄청 훌륭한 뷔페였으며, 옆에 KUB1 일본팀이 앉아 말을 걸고 싶었으나, 심리적 고민 1e9+7번 후에 실패했다. 그래도 일본의 physics0523님이 오셔서 말을 걸어주셨으며, 명함도 받고, 츄니즘과 작혼을 한다는 것도 알아내었다. 다만 작혼 서버가 달라서 친추를 못한 것이 한이다.&lt;br&gt;이야기가 샜지만, 밤에는 서울 리저널때의 Karuna의 조언처럼 게임 방송과 유튜브를 보며 잠을 청했다. 다만, 새벽 4시에 깨버려서 불안한 바삭, 꿀꺽 소리와 함께 유희왕 하얀숲(White Forest 줄여서 WF) 덱을 조금 하다가 잤다. 그래도 컨디션은 나쁘지 않았다.&lt;br&gt;&lt;br&gt;&lt;/p&gt;&lt;h3 data-ke-size=&quot;size23&quot;&gt;2.&amp;nbsp; from -2H to Start&amp;nbsp;&lt;/h3&gt;&lt;p data-ke-size=&quot;size16&quot;&gt;2024&amp;nbsp;서울리저널의&amp;nbsp;경험이&amp;nbsp;나쁘지&amp;nbsp;않았기&amp;nbsp;때문에&amp;nbsp;계속해서&amp;nbsp;비슷하게&amp;nbsp;하려고&amp;nbsp;했다.&amp;nbsp;신이&amp;nbsp;된다는&amp;nbsp;마음가짐,&amp;nbsp;혹은&amp;nbsp;신을&amp;nbsp;죽이는&amp;nbsp;자가&amp;nbsp;되겠다는&amp;nbsp;마음&amp;nbsp;가짐으로&amp;nbsp;&amp;nbsp;'카밋포이나'&amp;nbsp;커버곡을&amp;nbsp;계속&amp;nbsp;들어주고,&amp;nbsp;사카마타&amp;nbsp;프렌즈&amp;nbsp;인형과&amp;nbsp;함께&amp;nbsp;했다.&amp;nbsp;올해는&amp;nbsp;특별히&amp;nbsp;돌기도문을&amp;nbsp;한번&amp;nbsp;읽으며&amp;nbsp;다짐을&amp;nbsp;하였다.&amp;nbsp;gs25가&amp;nbsp;대회&amp;nbsp;시작&amp;nbsp;직전까지도&amp;nbsp;자려고&amp;nbsp;해서&amp;nbsp;굉장히&amp;nbsp;불안했지만,&amp;nbsp;나쁘지&amp;nbsp;않은&amp;nbsp;컨디션과&amp;nbsp;함께&amp;nbsp;대회는&amp;nbsp;시작되었다.&lt;br&gt;&amp;nbsp;&lt;/p&gt;&lt;h3 data-ke-size=&quot;size23&quot;&gt;3. 불안한 Opening ( 00 : 00 ~ 01 : 15 )&lt;/h3&gt;&lt;p data-ke-size=&quot;size16&quot; style=&quot;text-align: justify;&quot;&gt;하던대로&amp;nbsp;yijw가&amp;nbsp;ABCD,&amp;nbsp;내가&amp;nbsp;EFGH,&amp;nbsp;gs25가&amp;nbsp;템플릿&amp;nbsp;세팅&amp;nbsp;후&amp;nbsp;IJKLM을&amp;nbsp;맡게&amp;nbsp;되었다.&amp;nbsp;E는&amp;nbsp;읽다가&amp;nbsp;걸렀고,&amp;nbsp;F는&amp;nbsp;prefix, cht,&amp;nbsp;casework,&amp;nbsp;prefix&amp;nbsp;뽀이하게&amp;nbsp;하면&amp;nbsp;될&amp;nbsp;것&amp;nbsp;같다는&amp;nbsp;생각을&amp;nbsp;했으며,&amp;nbsp;G는&amp;nbsp;꽤나&amp;nbsp;쉽게&amp;nbsp;풀이가&amp;nbsp;나오게&amp;nbsp;되었다.&amp;nbsp;다만,&amp;nbsp;casework가&amp;nbsp;필요할&amp;nbsp;것&amp;nbsp;같아&amp;nbsp;풀이를&amp;nbsp;정리하고&amp;nbsp;있었다.&amp;nbsp;그&amp;nbsp;와중에&amp;nbsp;gs25는&amp;nbsp;가장&amp;nbsp;많이&amp;nbsp;풀린&amp;nbsp;L을&amp;nbsp;잡았으며,&amp;nbsp;yijw는&amp;nbsp;D&amp;nbsp;풀이를&amp;nbsp;내었다.&amp;nbsp; &lt;br&gt;&lt;br&gt;gs25가&amp;nbsp;L을&amp;nbsp;짜고&amp;nbsp;틀렸으며&amp;nbsp;멍한&amp;nbsp;모습을&amp;nbsp;보여주는데&amp;nbsp;술이&amp;nbsp;덜&amp;nbsp;깬거&amp;nbsp;같다는&amp;nbsp;말에&amp;nbsp;내&amp;nbsp;귀를&amp;nbsp;의심했다.&amp;nbsp;그래도&amp;nbsp;이어서&amp;nbsp;내가&amp;nbsp;G를&amp;nbsp;잡고&amp;nbsp;예제가&amp;nbsp;나오지&amp;nbsp;않았다.&amp;nbsp; &lt;br&gt;굉장히&amp;nbsp;불안한&amp;nbsp;상황이었지만,&amp;nbsp;침착함을 유지하고 출력 후 컴퓨터를 넘겼다. &lt;br&gt;&lt;br&gt;다행히 gs25가 정신을 다 차리고 L을 고쳤고, 나는 틀린부분을 찾은 후 침착함을 가져다 버리고 실수로 d.cpp를 한번 제출해 버린 다음 g에서도 1 WA를 기록했다.&lt;br&gt;결국 컴퓨터를 넘겨받은 yijw가 A를 풀고 나도 G에 return 한 줄을 추가하여 고치는데 성공했다.&lt;br&gt;&lt;br&gt;30등선에서 유지되며 별로 좋지 못한 시작이었다.&lt;/p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;636&quot; data-origin-height=&quot;42&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/nhMSt/btsMIrJaGhi/NEhpiNssXahNtihSjkZAn0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/nhMSt/btsMIrJaGhi/NEhpiNssXahNtihSjkZAn0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/nhMSt/btsMIrJaGhi/NEhpiNssXahNtihSjkZAn0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FnhMSt%2FbtsMIrJaGhi%2FNEhpiNssXahNtihSjkZAn0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;636&quot; height=&quot;42&quot; data-origin-width=&quot;636&quot; data-origin-height=&quot;42&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;p data-ke-size=&quot;size16&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;&lt;h3 data-ke-size=&quot;size23&quot;&gt;4. 폭발력의 Midgame ( 01 : 00 ~ 04 : 00 )&amp;nbsp;&lt;/h3&gt;&lt;p data-ke-size=&quot;size16&quot; style=&quot;text-align: justify;&quot;&gt;gs25는 L 이후에 J를 잡기 시작했으며, yijw는 풀이가 나와있던 D를, 나는 새로운 풀만한 문제를 찾으러 떠나다가 H가 그나마 할만해 보였다. &lt;br&gt;&lt;br&gt;둘 다 조금씩 삐끗하는 듯 보였으나, 얼마 지나지 않아 간식 테이블에서 간식을 먹으며 고민하니 gs25의 J와 yijw의 D가 둘다 ac를 받게 되었다! 이때를 기점으로 5등이라는 한자릿수 등수 대에 들어가게 되었지만, 추가 풀이가 나오지 않았기 때문에 키보드가 비고 순위가 쭉 내려갈 상황이었다.&lt;/p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;983&quot; data-origin-height=&quot;253&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/sh0w5/btsMHWPNU2A/R1HqKT2Vnup6pQ2iJEKi5K/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/sh0w5/btsMHWPNU2A/R1HqKT2Vnup6pQ2iJEKi5K/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/sh0w5/btsMHWPNU2A/R1HqKT2Vnup6pQ2iJEKi5K/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fsh0w5%2FbtsMHWPNU2A%2FR1HqKT2Vnup6pQ2iJEKi5K%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;615&quot; height=&quot;158&quot; data-origin-width=&quot;983&quot; data-origin-height=&quot;253&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;p data-ke-size=&quot;size16&quot; style=&quot;text-align: justify;&quot;&gt;여기서 3시간 이상 남은 시점이기에 나는 각자 문제를 잡는 것을 주장했지만, 스코어보드를 근거로 gs25,yijw 둘이 같이 i,k를 보기 시작했다. 그 와중에 나는 H의 풀이가 거의 정리되어 구현에 들어가기 시작했다.&amp;nbsp;&lt;br&gt;옆에서는 K(의 사풀)과 I의 풀이가 완성되었고, 나는 H에서 10번의 질문 쿼리중 2번만 쓰면 되는 기현상을 겪다가 쉬울거라고 생각한 케이스가 생각보다 중요하고 까다롭다는 것을 깨달아 I의 yijw에게 자리를 비켜주었다.&amp;nbsp;&lt;br&gt;수학에 강점이 있는 gs25와 같이 H를 토론하기 시작했다. 서로 관찰 추가, 풀이 생성, 반례 찾아주기, 풀이 수정의 환상적인 전성기 바르셀로나급 티키타카를 펼쳤다. 팀연습때 몇번 나왔던 둘의 시너지가 훌륭하게 발휘되는 순간이었다. 그 와중에 역겨운 구현도 잘 밀어주는 yijw가 i에서 WA를 조금 받았지만, 꿋꿋히 싸움을 이어나가고 있었다.&amp;nbsp;&lt;br&gt;그러다가 yijw의 I가 AC를 받아내고, 이어서 gs25와 내가 페어코딩 (내 코드에 gs25의 훌륭한 return 0; 추가 매드무비) 를 통해 이어서 H에서도 승전보가 울리게 되었다!!!! &lt;br&gt;각자의 완벽한 포지션 배정과 실행으로 등수는 순식간에 한자릿수 대로 올라가게 되었고, 환호성이 터져나왔으며, 온몸에 전율감과 안도감이 맴돌게 되었다. 이 시점에서 처음 목표였던 WF 진출은 사실상 확정이라고 생각이 되었다.&lt;/p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;864&quot; data-origin-height=&quot;25&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/cJq4SH/btsMHYtj5Ff/r3tjrLtcKHyfwWajHYCxkk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/cJq4SH/btsMHYtj5Ff/r3tjrLtcKHyfwWajHYCxkk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/cJq4SH/btsMHYtj5Ff/r3tjrLtcKHyfwWajHYCxkk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcJq4SH%2FbtsMHYtj5Ff%2Fr3tjrLtcKHyfwWajHYCxkk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;864&quot; height=&quot;25&quot; data-origin-width=&quot;864&quot; data-origin-height=&quot;25&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;678&quot; data-origin-height=&quot;73&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/DcIbl/btsMF4oDyDN/L1AazWj7Fp4j0XBH9rHTD1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/DcIbl/btsMF4oDyDN/L1AazWj7Fp4j0XBH9rHTD1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/DcIbl/btsMF4oDyDN/L1AazWj7Fp4j0XBH9rHTD1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FDcIbl%2FbtsMF4oDyDN%2FL1AazWj7Fp4j0XBH9rHTD1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;678&quot; height=&quot;73&quot; data-origin-width=&quot;678&quot; data-origin-height=&quot;73&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;&lt;br&gt;&lt;br&gt;5. 변화와 증명의 Ending. ( 04 : 00 ~ 05 : 00 )&lt;/h3&gt;&lt;p data-ke-size=&quot;size16&quot;&gt;DolAndDool의 게임은 끝나지 않았다. 최후의 솔브를 위해 F와 K에 대한 문제 읽기와 고민을 했으며, yijw는 C를 마저 구현하러 키보드를 잡았다. 나와 gs25는 F,K를 돌려읽고 토론을 시작했다. 나는 K에서 답이 N-lis 일지도? 라고 했다가 혼났고, gs25는 그 전에 찾아낸 결론인 답이 $i - 1 + n - j + ( i - j 구간의 inversion-counting)$ 의 최솟값이라는 말을 하였다. 내 N-lis가 틀린 이유를 찾다보니 gs25의 의견이 다시보였고, 저 식에 대해 좀 더 보려고 하니 바로 단조성이 있을 것 같은 feeling이 들었다.&amp;nbsp;&lt;br&gt;다만 나는 2022 SCPC 등의 ptsd가 있기 때문에 증명을 확실히 하고자 하였고, 그 와중에 gs25가 F에서 내가 미리 관찰해서 넘겨준 내용에 더해서 애매한 dp식을 세워놓고 같이 발전시켜보자고 했지만, 나는 F의 가능성이 별로 없어보였고 이미 단조성 증명에 온 신경이 쏟아져있었다. 조금의 산책후에 나는 gs25에게 좋은 소식과 나쁜 소식을 들고 왔다. 나쁜 소식은 내가 사실 F 고민을 안했다는 것. 그리고 좋은 소식은 K의 단조성 증명이 끝났다는 것.&lt;br&gt;yijw는 C의 가능성이 별로 높지 않다고 했고, 우리는 최후의 45분을 K에 도전하기로 하였다.&lt;br&gt;&lt;br&gt;서울리저널의 실수를 반복하지 않기 위해 셋이 풀이를 깔끔하게 찾기, 공유하기, 이해하기의 시간을 가졌고, 이 과정에서 구간의 inversion counting 관련하여 시간복잡도 이슈가 발견되었다. 추가 고민을 통해 PST풀이 -&amp;gt; ODC식의 풀이 -&amp;gt; 투포인터를 이용한 advertised $O(Nlg^2N)$ 의 풀이가 완성되었다.&amp;nbsp;&lt;br&gt;이때 N=500000 이었기 때문에, gs25가 펜윅 사용을 주장했고, 우리중 &lt;b&gt;유일하게 펜윅 구현이 가능한&lt;/b&gt; gs25가 펜윅 부분을 구현하였다. 나머지는 서울 리저널 때처럼 yijw가 중간에서 키보드를 잡고, 양쪽에서 보면서 피드백과 오타 수정을 도왔다. 구현끝에 결국 예제가 나오게 되었고 제출을 하였다.&lt;br&gt;길게 돌아가는 채점 중... 이라는 메세지.&lt;br&gt;같이 길어지는 나의 다양한 부두술과 함께...&lt;br&gt;&lt;b&gt;Finally AC!&lt;/b&gt;&lt;br&gt;서울리저널때와는 다르다는 것을 보여주는 화려한 마무리였다.&lt;br&gt;남은 시간은 기쁨을 만끽하고 C에 제출을 시도하며 대회의 종료를 맞이하였다.&lt;br&gt;&lt;br&gt;&lt;/p&gt;&lt;h3 data-ke-size=&quot;size23&quot;&gt;6. Afterstory&lt;/h3&gt;&lt;p data-ke-size=&quot;size16&quot;&gt;내가 개인적으로 예상한 등수는 6~7등이었다. 또한, 한국팀들이 전체적으로 부진했기 때문에, 핸드폰 안에서만 떠들며 시간을 조금 보냈다. 그와중에 cross_ratio가 몇 솔브인지 굉장히 궁금해했고, 나는 K풀이를 질문하고 단조성이 있는지 놀라는 척을 하며 화답했다.&lt;br&gt;얌전히 시상식장으로 가는 길에 physics0523을 다시 만나 &quot;You team good?&quot; 이라 물어보니 &quot;Soso&quot; 라는 답을 듣게 되었다.&lt;br&gt;&lt;br&gt;&lt;/p&gt;&lt;h3 data-ke-size=&quot;size23&quot;&gt;7. Is the Road Golden....???&lt;/h3&gt;&lt;p data-ke-size=&quot;size16&quot;&gt;팀원들에게는 동메달인지 은메달인지 모르겠다고 했지만 사실 은메달을 예상하고 있었다. 그렇게 스코어보드가 하나씩 공개 되는데 생각보다 많은 제출이 299분에 된 것을 볼 수 있었다. 근데 대회장에서 마지막 1분동안 아무런 환호성을 듣지 못했기 때문에 다 WA일 것이라고 예상했고, 이에 더해서 실제로 많은 팀들이 freeze (4시간 시점) 이후에 솔브 수를 늘리지 못해서 기대감이 점점 증폭되었다.&lt;br&gt;점점 금메달이 농담에서 현실로 다가오는 중에 마지막 기로가 니왔다. 남은 은메달은 한자리였고, 일본의 KUB1팀이 못 풀면 우리가 4등으로 금메달, 풀면 은메달이 될 것 같은 상황이었다. physics0523의 soso에서 어느정도 예상했듯이 KUB1은 프리즈 이후 추가솔브를 기록하며 우리 위로 올라가게 되었다.&lt;br&gt;우리팀은 그래도 기뻐하고 자축하며 약간은 아쉽지만 5등도 목표에 비해 굉장히 높은 수치이기 때문에 기뻐하고 있었는데, 갑자기 std_abs팀이 freeze이후 260분 최종 제출, 264분 최종 제출이 둘다 WA를 받는 대참사가 일어났다. 장례식인가요? 아니 축제인데요?&amp;nbsp;&lt;br&gt;걷잡을 수 없는 놀람과 환호성을 작게 지르게 되었고, 진정을 하며 우리 차례를 기다렸다.&lt;br&gt;그리고... 당당하게... APAC 4등!!!&lt;br&gt;이번 대회에서의 돌기도문은 길을 걷는, 길을 만들어 걷는자. 였기 때문에 내가 만들어 걸은 길은 Golden Road가 되었다. 그렇게 다음날은 비행기에 탈 때까지 인스타, 디코, 에브리 타임 등등에 자랑하고 계속해서 '내가 누구? ICPC APAC 2025 Gold Medalist!' 를 되뇌이며 시간을 보내고 마무리 되었다.&lt;br&gt;&lt;br&gt;&lt;/p&gt;&lt;figure class=&quot;imagegridblock&quot;&gt;
  &lt;div class=&quot;image-container&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/pNEGx/btsMGM8OxLT/7kWDxpigv0AVhAKPxyn520/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/pNEGx/btsMGM8OxLT/7kWDxpigv0AVhAKPxyn520/img.png&quot; data-origin-width=&quot;642&quot; data-origin-height=&quot;366&quot; style=&quot;width: 62.68%;&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/pNEGx/btsMGM8OxLT/7kWDxpigv0AVhAKPxyn520/img.png&quot; alt=&quot;&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FpNEGx%2FbtsMGM8OxLT%2F7kWDxpigv0AVhAKPxyn520%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;642&quot; height=&quot;366&quot;/&gt;&lt;/span&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/PNy4E/btsMIcFkzFu/AvXlWV0Kc7yBnDCc23N5o0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/PNy4E/btsMIcFkzFu/AvXlWV0Kc7yBnDCc23N5o0/img.png&quot; data-origin-width=&quot;512&quot; data-origin-height=&quot;506&quot; style=&quot;width: 36.1572%;&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/PNy4E/btsMIcFkzFu/AvXlWV0Kc7yBnDCc23N5o0/img.png&quot; alt=&quot;&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FPNy4E%2FbtsMIcFkzFu%2FAvXlWV0Kc7yBnDCc23N5o0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;512&quot; height=&quot;506&quot;/&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1130&quot; data-origin-height=&quot;64&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/cmKuPg/btsMGOFzFa8/NEJDe37OGkx606BHSErgik/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/cmKuPg/btsMGOFzFa8/NEJDe37OGkx606BHSErgik/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/cmKuPg/btsMGOFzFa8/NEJDe37OGkx606BHSErgik/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcmKuPg%2FbtsMGOFzFa8%2FNEJDe37OGkx606BHSErgik%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1130&quot; height=&quot;64&quot; data-origin-width=&quot;1130&quot; data-origin-height=&quot;64&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;/p&gt;&lt;h3 style=&quot;text-align: justify;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;br&gt;&lt;br&gt;8. Epliogue&lt;/h3&gt;&lt;p data-ke-size=&quot;size16&quot;&gt;기본적으로 큰 말림 없이 세명이 모두 잘해주었고, DolAndDool 팀이 낼 수 있는 거의 최고의 성적을 냈다고 생각한다.&amp;nbsp;&lt;br&gt;이에 더해 이정도 퍼포먼스의 3명 (CF 2560,2250,2110) 이 모여서 낼 수 있는 결과 중에도 거의 최고라고 생각한다. 그만큼 서로 다양한 대화를 통해 서로를 알아갔으며, 그 전에 이미 3명의 장점과 단점이 잘 맞아떨어지는 부분이 있다고 생각한다.&lt;br&gt;특히 늦게 시작했지만 엄청난 연습량으로 따라와주어서 마지막 퍼즐 조각이 되어준 gs25와 항상 묵묵히 고단한 작업을 맡아주는 yijw에게 감사하며, WF에서도 힘내자는 말을 하려고 한다.&lt;br&gt;&lt;br&gt;그 밖에 심리적으로, 물리적으로, 학업적으로 도와준 정말 수많은 사람들에게 감사한다.&lt;br&gt;&lt;br&gt;마지막으로 외쳐본다&lt;br&gt;Let DnD go WF!&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp;&lt;/p&gt;</description>
      <category>일상/대회 참가 후기</category>
      <author>stonejjun</author>
      <guid isPermaLink="true">https://stonejjun.tistory.com/220</guid>
      <comments>https://stonejjun.tistory.com/220#entry220comment</comments>
      <pubDate>Mon, 3 Mar 2025 22:58:46 +0900</pubDate>
    </item>
    <item>
      <title>ICPC 2024 서울 리저널 본선 후기</title>
      <link>https://stonejjun.tistory.com/218</link>
      <description>&lt;p data-ke-size=&quot;size16&quot;&gt;대회 준비 과정은 &lt;a href=&quot;https://stonejjun.tistory.com/217&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;이 글&lt;/a&gt; 에서 볼 수 있습니다.&lt;/p&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;0. Prologue&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;다시 소개를 하자면 저희의 팀명은 DolAndDool 이며 팀원은 gs25, stonejjun03, yijw0930 입니다.&lt;br /&gt;팀의 큰 목표는 월드 파이널 진출이기 때문에 아시아 리저널 진출이 1차 목표이지만, 두 명 모두 서울 리저널 수상 경험이 없기 때문에 수상 또한 목표입니다.&lt;br /&gt;다만 포스텍,연세대,서강대,한양대 등의 늘있는 수상권 근처 wwe 뿐만 아니라 너무 많은 잘하는 서울대/카이스트 팀이 본선에 진출한 것이 큰 악재였습니다.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;예비 소집 날 갑자기 마라샹궈가 먹고 싶어졌으며, 매운 것과 ps 실력 어쩌고의 밈도 생각나서 마라샹궈 크게 한 대접을 저녁으로 먹었습니다.&amp;nbsp;&lt;br /&gt;좀 불안했지만 푹 자라, 마음을 비워라, 유튜브나 봐라라고 조언한 karuna의 말에 따라서 딱히 고민 없이 롤토체스를 좀 하다가 잤습니다. 전 대회 때 너무 큰 의미부여를 하고 긴장을 해서 아쉬운 결과가 나왔기 때문에 더더욱 편하게 지냈던 것 같습니다.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;대회 날 30분 정도만에 KINTEX에 도착했습니다. 가깝고 꽤나 와본 만큼 홈그라운드 같은 느낌이 들었습니다. 일찍 도착을 해서 plast를 만나 반가운 마음에 인사했지만 저를 기억 못하셨습니다...&amp;nbsp; ㅡㅅㅡ&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;바람을 쐬며 마음에 드는 커버곡을 듣기도 하고, 주위에 아는 사람들과 인사도 좀 나눴습니다. 특히 한국팀이 우승을 해야 아시아 진출을 할 가능성이 높아지기 때문에 &lt;a href=&quot;https://leinad2.tistory.com/30&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;진심으로 우승&lt;/a&gt;을 응원하는 말 또한 전했습니다. 다만 옛날과 다르게 참가자에 아는 얼굴이 굉장히 적다고 느껴 슬펐습니다.&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;팀원들과 &lt;b&gt;&quot;특정대화&quot;&amp;nbsp;&lt;/b&gt;를 하고 농담도 하며 긴장을 풀었습니다. 전문 중 일부를 발췌하면 아래와 같습니다.&lt;br /&gt;&quot;나 suffix automaton 공부했는데 진짜 좋더라.&quot;&lt;br /&gt;&quot;근데 님 그럼 eertree도 공부 했음?&quot; &lt;br /&gt;&quot;아니, 안했는데?&quot; &lt;br /&gt;&quot;ㅋㅋ 근데 나도 몰라 그래서 팀노트에도 없음&quot;&lt;br /&gt;&quot;ㅋㅋㅋㅋㅋㅋ&quot;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;주위에 알고 있는 강팀이 없다는 것을 확인했고 간식은 가방에 담아 책상에 내려놓은 후, 기다리고 있으니 반가운 목소리가 이러한 대사를 외치는 것을 들을 수 있었습니다.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;시작~~~~~하겠습니다 !!!&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;1. Opening&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;모니터를 오른쪽으로 옮길 수 없어 gs25가 템플릿 작성, 제가 efgh, yijw가 ijkl을 보게 되었습니다. 이렇다할 진전이 없었으며, 보고 있는 문제들이 심상치 않다고 느꼈기 때문에 A가 풀리자마자 A를 보러 갔습니다.&amp;nbsp;&lt;br /&gt;&amp;nbsp;그렇게 풀이가 나온 후 5분 정도면 구현을 한다고 선언하고, 5분만에 Wrong answer을 뽑아내었습니다. 그 사이 yijw가 C를 보고 있었으며, gs25는 G와 B를 보다가 L로 넘어갔습니다. 그 사이에 A에서 틀린부분을 찾아내어 고쳤고, B를 풀기 시작했습니다.&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;color: #555555; text-align: start;&quot;&gt;A : AC (00 : 24) (+1)&lt;/span&gt; &lt;span style=&quot;color: #555555; text-align: start;&quot;&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;B는 보고서 너무 많은 팀이 풀었지만 이분 매칭밖에 생각이 안나 그냥 이분매칭을 짜기로 했습니다. 그렇게 좀 오래 걸릴 거 같은 구현을 했지만 예제가 나오지 않았고, 출력을 요청한 후 C 풀이가 나온 yijw 에게 넘겼지만 코드가 오지 않았습니다.&amp;nbsp;&lt;br /&gt;얼핏보니 제출 기록에 Wrong-Answer가 보였고... 팀원한테 미안하다고 한 후 다시 출력요청을 했습니다.&amp;nbsp;&lt;br /&gt;그리고서 제출한 C에서는 TLE가 떳기 때문에 악재의 연속이 겹친 오프닝이었습니다.&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;B : WA&lt;br /&gt;C : WA&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1643&quot; data-origin-height=&quot;55&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/yjPAy/btsK4O00bEG/BgGN3G8j65ShjosbuqnIgk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/yjPAy/btsK4O00bEG/BgGN3G8j65ShjosbuqnIgk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/yjPAy/btsK4O00bEG/BgGN3G8j65ShjosbuqnIgk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FyjPAy%2FbtsK4O00bEG%2FBgGN3G8j65ShjosbuqnIgk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1643&quot; height=&quot;55&quot; data-origin-width=&quot;1643&quot; data-origin-height=&quot;55&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;시작 후 1시간 시점의 상태입니다. 이 시점에 1등팀은 무려 5솔을 하고 있었습니다. UCPC 때는 초반에 1등을 했었을만큼 초중반 타이밍에 강점이 좀 있는 팀이라고 생각을 했었기 때문에 위와 같은 상황은 더 아프게 다가왔습니다.&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;2. 상승&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;바로 이어서 gs25가 L 구현을 시작했습니다. 저는 B코드, yijw는 C코드를 확인하고 있었습니다. 고쳐야 되는 부분을 모두 확인한 저는 빠르게 컴퓨터를 뺏어 고친 후 제출을 하여 AC를 받았습니다. 이후 바로 gs25가 L에서 AC를 받았으며, 곧바로 이어서 yijw가 C에서 최적화 할 수 있는 부분을 열심히 찾아서 수정했지만, C에서는 여전히 TLE가 났습니다.&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;B : AC (01:09) (+1)&lt;br /&gt;L : AC (01:13)&amp;nbsp;&lt;br /&gt;C : WA&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;J풀이도 마저 정리된 gs25가 컴퓨터를 이어 받아 빠르게 구현을 하여 깔끔하게 구현을 성공시켜주었으며 저는 문제들을 읽다가 F로 넘어갔고, yijw가 마침내 C에서 AC를 띄우게 됩니다!!!!&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;J : AC (01:24)&amp;nbsp;&lt;br /&gt;C : AC (01:34) (+2) (First Solve!!!)&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;C에서 퍼솔을 이루는 쾌거를 보였지만, 사실 이제부터 시작입니다. 정확히는 그동안 밀려있었던 문제를 해결한 것이기 때문에 패널티 싸움에서도 굉장히 불리합니다. 그래도 굉장히 좋은 분위기 속에서 저는 F, gs25는 K, yijw는 D를 보기 시작했습니다.&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;어렵지 않게 F 풀이를 생각해낸 D에서 저와 2D 세그를 짜야한다고 주장한 yijw, K의 풀이가 나와 정리하고 있는 gs25가 있었고, midgame 목표는 이 3문제의 해결로 잡았습니다. 제가 F풀이를 마저 정리하는동안 yijw가 2d 세그를 구현했으며, 정리가 끝난 후에 컴퓨터를 뺏고 30분 선언 후에 구현을 끝마쳤습니다. 결과는... AC!&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;초반에 말린 것 이상으로 열심히 복구가 되고 있었기 때문에 박수와 환호를 많이 내뱉었으며, 분위기도 굉장히 좋았습니다.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;저는 다른 문제들을 읽었으며, gs25가 이어서 K 구현을 진행했지만, wa를 받게 됩니다. 먼저 봐주고 있던 yijw는 D로 보내고 제가 이어서 도움을 한 결과 suffix가 아닌 prefix인 것을 확인하고 고쳐서 제출했지만 예상치 못한 TLE를 받게 됩니다.&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;F : AC (02:22)&amp;nbsp;&lt;br /&gt;K : WA * 2&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1150&quot; data-origin-height=&quot;58&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/VJEvU/btsK6AOLeJA/QEyVGcqDbsiiKTnoKVkWKk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/VJEvU/btsK6AOLeJA/QEyVGcqDbsiiKTnoKVkWKk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/VJEvU/btsK6AOLeJA/QEyVGcqDbsiiKTnoKVkWKk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FVJEvU%2FbtsK6AOLeJA%2FQEyVGcqDbsiiKTnoKVkWKk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1150&quot; height=&quot;58&quot; data-origin-width=&quot;1150&quot; data-origin-height=&quot;58&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;3시간이 지난 시점에서 10등이라는 꽤나 준수한 성적을 거두고 있었으며 K에서 살짝 막혔으나 고치는 중이고, D도 어느정도 디버깅에 돌입 중이었기에 꽤나 희망적인 상황이라고 생각했습니다.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;3. 고전&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;K에서 26N에서 줄일 방법을 생각하고 있던 중에 monotone technique이 생각이 났으며, gs25에게 다른 문제를 보게 할까 하다가 그 코드에서 조금만 고치면 되는 거였기에 옆에서 봐달라고 하고 구현을 했습니다. 다만 계속해서 TLE와 예상치 못한 RE가 나왔기 때문에 나와서 천천히 gs25에게 풀이 설명을 하였습니다.&lt;br /&gt;&amp;nbsp; 이 과정에서 전부 빼다가 다시 하나를 넣지 않아도 된다는 것을 증명하고 들어갔었는데 설명을 하다보니 하나를 다시 넣어야 한다는 것을 깨달았습니다. 이 파트까지 설명하니 gs25도 풀이를 납득했고, D에서 2d 세그의 결과가 나오지 않아 힘들어 하고 있는 yijw를 뒤로 하고 수정을 하였으나 아직도 TLE를 받게 됩니다.&amp;nbsp;&lt;br /&gt;&amp;nbsp;멘탈이 굉장히 흔들리고 있는 시점에서 이상한 파트에 의심을 계속 하고 있었고, 마지막에 min값을 바꿔주는 chmin 함수가 int 형으로 되어 있다는 사실을 깨닫게 됩니다. 이 부분까지 고치고 나니 AC가 나오게 되었습니다.&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;K : AC (04:00) (+5)&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1157&quot; data-origin-height=&quot;68&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/UsagR/btsK6rqIBTp/TbC1kYKnBmJeburI9Ir4kk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/UsagR/btsK6rqIBTp/TbC1kYKnBmJeburI9Ir4kk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/UsagR/btsK6rqIBTp/TbC1kYKnBmJeburI9Ir4kk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FUsagR%2FbtsK6rqIBTp%2FTbC1kYKnBmJeburI9Ir4kk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1157&quot; height=&quot;68&quot; data-origin-width=&quot;1157&quot; data-origin-height=&quot;68&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;4시간 시점에서 11등이긴 했으나, 엄청난 패널티를 가지고 있었고, 나온 풀이는 0솔이며 2d 세그에서 고전하고 있는 D 하나 뿐이었습니다.&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;4. 엔드 게임 - There is no game&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;gs25는 D를 도와주었으며, 저도 D를 도울까 하다가 H를 읽었습니다. H를 읽으면서 바로 큰작을 쓰면 될 것 같다고 생각이 되었기 때문에 gs25에게 설명을 하려 했으나 문제를 보는 방향성과 스타일의 차이로 소통에 문제를 겪게 됩니다.&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;이 시점에서 팀원을 소집하여 D or H의 선택과 집중을 선언했습니다. H를 보기로 하였기 때문에 문제를 읽고 온 yijw에게 H 풀이를 설명해주었고 애매해서 고민 및 정리 있던 부분을 yijw가 할 수 있는 것 같아 구현을 넘겼습니다. D에서 멘탈이 나갔다고 힘들다고 말했지만, 내 구현에 자신이 없어 yijw가 키보드를 잡고 3명이 같이 트리플 페어 코딩을 하기로 하였습니다.&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;구현을 했고, 디버깅을 도우며 했고, 마지막에 딱 제출을 했습니다!!!&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;하지만 결국 WA를 받으며 대회가 끝나게 되었습니다.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;결국 프리즈 이후에 하나도 풀지 못하며 존재하지 않는 엔드게임이 되고 말았습니다.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;5. 정리&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;7솔 중에서도 패널티 때문에 하위권으로 예상했으며, 무엇보다 프리즈 이후에 6솔팀 중 1솔을 더한거 같은 팀이 많이 보였기 때문에 수상은 못할 것으로 보였고, 적당히 한국팀이 우승한다는 가정하에 아시아는 나갈 것으로 예측 되었습니다.&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;딱 못할만큼 못하고 잘할만큼 잘했으며, 팀원 모두가 잘한점과 못한점이 있다고 생각했으나 gs25는 굉장히 망연자실해 하고 있었습니다.&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;발전해야할 점과 중간에 있었던 소통 관련 이슈들 등에 대해서 건피(건전한 피드백)을 진행하면서 담아두었던 생각들이나 말을 교환하고 발전을 도모 했습니다.&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;특히 관찰 -&amp;gt; 대략적 풀이와 감각 -&amp;gt; 풀이의 증명, 마무리 -&amp;gt; 구현 부분에서 저는 1,2 번에 강점이 있었고, gs25는 1,3 번에 강점이 있었기 때문에 이러한 부분에 대해서 이야기 하고, 각자 부족한 점을 열심히 보완하는 것으로 결론지었습니다.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;개인적으로 생각하는 부분에서 yijw는 C에서 굉장히 잘해주었으나 D를 오래 잡다가 말려버렸고, gs25는 jkl에서 잘해주었으나, k의 구현 이슈에서 두 명에게 의지한 점과 문제 해석이슈가 있었으며, 저는 전반적으로 풀이를 잘 내었으나 초반에 느린 속도와 WA로 패널티를 쌓는데 기여했으며 K에서 늘 있던 증명 디테일 문제와 H에서도 구현 자신감으로 인해 떠넘ㄱ니 점이 아쉬웠습니다.&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;개인적으로는 8솔을 했으면 정말 할만큼 했다고 생각할 수 있었을텐데라는 아쉬움과, 그래도 서울 리저널에서 이 정도 못한거면 그리 못한거 까지는 아니다, 참작해줄만 하다라는 생각을 하였습니다.&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;왜냐하면 최근 19~23 기출을 쭉 풀면서 해가 갈 수록 문제가 어려운 것과 별개로 까다롭고 팩팩?해졌다는 느낌을 강하게 받아 서울리저널에서는 엄청 잘 말리게 되고, 실수가 엄청 나오며, 본 실력을 발휘하기 어렵다라는 인식을 강하게 가지고 있었기 때문입니다.&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;6. 발표&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;큰 기대는 하지 않았습니다. 그런데 6솔팀들이 계속해서 7솔브로 넘어가지 못하는 모습이 보였기 때문에 희망이 조금씩 자라났으나, 저희는 H를 풀지 못했다는 것을 알고 있었으며 이미 14등 밖으로 밀려나 있었기 때문에 아쉽게 마무리 되었다고 생각했습니다.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;그런데...&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1911&quot; data-origin-height=&quot;772&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/zHTGu/btsK4xfdfM4/KsMShv4vHdDgVvDfp9BZt1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/zHTGu/btsK4xfdfM4/KsMShv4vHdDgVvDfp9BZt1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/zHTGu/btsK4xfdfM4/KsMShv4vHdDgVvDfp9BZt1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FzHTGu%2FbtsK4xfdfM4%2FKsMShv4vHdDgVvDfp9BZt1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1911&quot; height=&quot;772&quot; data-origin-width=&quot;1911&quot; data-origin-height=&quot;772&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;Let DnD get Awards ???!!!!&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;해외팀들의 참전을 까먹고 있었습니다. 결과적으로 저희는 장려상(발표 보드 오류)을 수상하게 되었으며, 아마 수상 발표당시 반응은 대상감이었습니다. 처음으로 공개된 수상팀이기도 하며, 팀원 전부가 수상을 못할것이라고 생각하고 있었기 때문에 더욱 격렬한 반응이 나오게 되었습니다.&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1100&quot; data-origin-height=&quot;64&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/n7Alz/btsK4107raU/Bwyrd7KkKjyBXFnpQMkKH0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/n7Alz/btsK4107raU/Bwyrd7KkKjyBXFnpQMkKH0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/n7Alz/btsK4107raU/Bwyrd7KkKjyBXFnpQMkKH0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fn7Alz%2FbtsK4107raU%2FBwyrd7KkKjyBXFnpQMkKH0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1100&quot; height=&quot;64&quot; data-origin-width=&quot;1100&quot; data-origin-height=&quot;64&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;645&quot; data-origin-height=&quot;61&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bAlA1u/btsK6LvKOCE/lGwl4lEPXGs3VrI9S4snm1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bAlA1u/btsK6LvKOCE/lGwl4lEPXGs3VrI9S4snm1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bAlA1u/btsK6LvKOCE/lGwl4lEPXGs3VrI9S4snm1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbAlA1u%2FbtsK6LvKOCE%2FlGwl4lEPXGs3VrI9S4snm1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;645&quot; height=&quot;61&quot; data-origin-width=&quot;645&quot; data-origin-height=&quot;61&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;그렇게 최종 등수는 16등, 한국 팀 기준 12등으로 장려상을 수상하게 되었습니다.&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;최고의 결과는 아니었지만, 그래도 열심히 노력했고, 그 증표가 남았기에 굉장히 값진 결과이지 않을까 싶습니다.&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;팀원들이 팀대회를 해보지 않아서 좀 더 혹독하게 말하고, 주장하고, 진행해왔는데 정말 잘 해준 팀원들에게도 너무 고마운 것 같습니다.&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;///&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;옆에 블아 행사가 끝나기도 했고, 또래 참가자가 거의 없어 딱히 모임 없이 그냥 제공해준 국밥을 먹었습니다... 대회중에 밥도 안먹을 정도였네요. 또한 새삼 4학년인게 크게 느껴지네요.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;7. Apilogue&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;DnD (필자는 Trpg를 꽤나 좋아하기 때문에 팀 약자를 DnD로 표기하는 것을 즐깁니다) 의 여정은 끝나지 않았습니다. 아마 아시아 퍼시픽 대회 진출은 안정권인 것으로 알고 있습니다.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;값진 성과도 얻어냈지만 결국 저희 팀이 목표하는 바는 ICPC WF 진출이기 때문에, 약점은 보완하고 체급도 키운 성장한 DnD가 되어 돌아올 예정입니다.&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;정말 많은 사람들의 도움이 있었습니다. 다만 이를 안고 가지는 않으려 합니다. 부담을 털어내는 쪽이 저와는 좀 더 잘 맞는 것 같더라구요. 다만 좋은 성적을 거두고 와서 감사인사로 보답하겠습니다!&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;그럼 싱가포르에서 뵙겠습니다!&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;See you at The 2025 ICPC Asia Pacific Championship! ... and ... Let DnD go WF !&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;</description>
      <category>일상/대회 참가 후기</category>
      <author>stonejjun</author>
      <guid isPermaLink="true">https://stonejjun.tistory.com/218</guid>
      <comments>https://stonejjun.tistory.com/218#entry218comment</comments>
      <pubDate>Mon, 2 Dec 2024 19:50:37 +0900</pubDate>
    </item>
    <item>
      <title>DolAndDool 의 2024 ICPC 준비기</title>
      <link>https://stonejjun.tistory.com/217</link>
      <description>&lt;h3 data-ke-size=&quot;size23&quot;&gt;0. Prologue&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;오랜만에 복귀하여 ICPC 2024를 위하여 적당히 달려왔습니다. 결론부터 말하자면 얼마 전 &lt;span style=&quot;color: #666666; text-align: start;&quot;&gt;2024 ICPC seoul regional 수상으로 마무리하였고, 아마 1차 목표인 아시아 퍼시픽 리저널에 출전할 수 있을 것으로 보여집니다. 그 긴 여정과 마지막 대회까지의 긴 이야기를 적어보려고 합니다.&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;1. Coding Dol and Dool&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;작년에 모종의 이유로 예선에도 나갈 수 없었지만, 올해 yijw0930과 함께 팀을 하기로 말해 놓았습니다. 미리 말해놓지 않았으면 빼앗겼을, 고려대에서 굉장히 중요한 인물이었기 때문에 이는 최고의 선택이 되었습니다.&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp; gs25는 2~3년 전쯤에 적당히 찍먹하고 접었습니다. 그러다가 작년 11월부터 다시 열심히 시작했습니다. 기본적으로 수학올림피아드를 했었고, 머리가 좋으며, 하나에 꽃히면 정말 몰두하는 경향이 있습니다. 또한, 편식등과 같은 좋지 못한 공부 방법과 습관을 제가 겪어본 입장에서 조금은 더 힘들지만 올바른 방향으로 나아가도록 옆에서 열심히 도와줬습니다.&lt;br /&gt;&amp;nbsp;그 과정에서 팀원으로 고려를 했으며, 이러한 사실들을 넌지시 흘림으로써 gs25의 의욕을 더 끌어올렸습니다. 그 결과 겨울 방학 동안 많은 실력 상승을 하였으며, 같이 팀으로 하기로 결정되었습니다.&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;그렇게 결정된 저희의 팀명은 (Coding) DolAndDool 이며 팀원은 &lt;a style=&quot;background-color: #ffffff; color: #0076c0; text-align: start;&quot; href=&quot;https://www.acmicpc.net/user/gs25&quot;&gt;&lt;span style=&quot;color: #ff8c00;&quot;&gt;gs25&lt;/span&gt;&lt;/a&gt;, &lt;a style=&quot;background-color: #ffffff; color: #0076c0; text-align: start;&quot; href=&quot;https://www.acmicpc.net/user/stonejjun03&quot;&gt;&lt;span style=&quot;color: #ff8c00;&quot;&gt;stonejjun03&lt;/span&gt;&lt;/a&gt;, &lt;a style=&quot;background-color: #ffffff; color: #0076c0; text-align: start;&quot; href=&quot;https://www.acmicpc.net/user/yijw0930&quot;&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;yijw0930&lt;/span&gt;&lt;/a&gt; 로 결정되었습니다. 심심치 않게 볼 수 있는 서울대와 카이스트 다음의 몇몇 대학들에서 나오는 평균 2300+ 정도의 수상권 언저리를 보는 적당히 강한 팀이 완성되었습니다.&amp;nbsp;&lt;br /&gt;&amp;nbsp;나름 밸런스도 갖춰져 있으며, 성장 가능성 또한 있고, 모두 대학교 4학년이며 7년을 함께 했다는 점도 굉장한 강점으로 작용할 수 있어보입니다.&amp;nbsp;&lt;br /&gt;&amp;nbsp;다만 ps를 오래 놓은 저와 성장 중인 gs25의 체급 문제 또한 있었으며, 시너지도 확인을 해봐야 하는 것은 사실입니다.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;2. Team - DolAndDool&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;함께 나간 첫 대회는 UCPC로 중간에 1등을 잠깐 하는 기염을 토했으나 결국 마지막에 3명이 각자 문제를 잡고 고통을 받는 '그 초식'이 나오게 되어 아쉬운 12등으로 마무리를 하게 됩니다.&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1651&quot; data-origin-height=&quot;63&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/0w0KU/btsK5pmduLy/l7pDZYn8vPZ0lF84VwAYRk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/0w0KU/btsK5pmduLy/l7pDZYn8vPZ0lF84VwAYRk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/0w0KU/btsK5pmduLy/l7pDZYn8vPZ0lF84VwAYRk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2F0w0KU%2FbtsK5pmduLy%2Fl7pDZYn8vPZ0lF84VwAYRk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1651&quot; height=&quot;63&quot; data-origin-width=&quot;1651&quot; data-origin-height=&quot;63&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;이후 팀연습을 1~2 주마다 한 번씩 했습니다. yijw는 자료구조에 강한 강점이 있으며 구현력이 좋아 상수 역할을 해주고 있습니다. gs25는 문제를 본 직후의 일감이 굉장히 좋으며, 구현에는 조금 어려움을 호소하지만, 풀이에서 반례 등의 디테일을 집어내는 등의 풀이를 '완성' 시키는 것에 굉장한 강점을 가지고 있습니다. 저는 거시적 느낌의 풀이를 내는 것에 강점이 있으며, 다양한 팀 대회 경험을 바탕으로 IGL을 담당하고 있습니다.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;팀 연습 과정에서 잘 될 때는 서로의 약점을 보완하며 척척 굴러가지만, 말릴 때는 중반부터 끝없이 말리는 경험을 하였습니다. 그러던 중 올해 10월즈음 &lt;a href=&quot;https://www.acmicpc.net/user/jhwest2&quot;&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;karuna&lt;/span&gt;&lt;/a&gt; 와 함께 이야기를 나눴으며, 다음과 같은 이야기를 받았습니다.&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;icpc 서울 리저널 기출을 돌 때 구현 전에 최대한 정리하고 구현을 시작하여 키보드를 잡기 시작한 이후의 시간을 재면서 미는 개인 연습을 해라.&lt;/li&gt;
&lt;li&gt;팀연습을 한번 봐주겠다.&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;이후 다음 팀 연습에 실제로 중간에 subway까지 나가서 사다 줄 정도로 최선을 다해 도와주었으며 정말 다양한 피드백을 해주었습니다. (Special Thx to Karuna) 그 중 일부는 아래와 같습니다.&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;문제 분배와 시작 템플릿 작성에 있어 항상 일관된 오프닝을 정해놓고 실행해라.&lt;/li&gt;
&lt;li&gt;자신의 상태를 열심히 공유해라.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;말리면 무조건적으로 도움 요청을 적극적으로 해라&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;특히 도움요청은 정말 중요한 요소로 꼭 고쳐야 할 사항이었습니다. 이를 바탕으로 팀 연습을 몇 번 더 하며 점점 하나의 팀으로서 시너지를 발휘하기 시작하였습니다.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size23&quot;&gt;3. From 예선 To 본선&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;예선을 친 후 정말 최악의 분위기였으나 다른 이슈를 깨닫고 마음을 다잡고 다시 열심히 하였습니다. 전반적으로 리저널을 미는 개인연습 위주로 돌아갔으며, 저는 특히 2023 기출을 풀며 자신감을 많이 잃어버렸지만, 확실히 gs25의 체급이 느는것이 보였습니다. 비유적으로 표현하자면 구현에 대한 비위가 굉장히 약했었고, 이 부분이 큰 약점이었는데, 꾸역꾸역 리저널 특유의 문제들을 먹으면서 비위가 꽤나 강력해졌습니다.&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;다들 최근 5년의 문제를 45~50문제 이상 해결 했으며, 계속 언급되던 팀노트도 팀에 맞게 수정을 하여 고쳤습니다. 그렇게 긴 준비가 결실을 맺을 날이 다가오고 있었습니다.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;</description>
      <category>일상/대회 참가 후기</category>
      <author>stonejjun</author>
      <guid isPermaLink="true">https://stonejjun.tistory.com/217</guid>
      <comments>https://stonejjun.tistory.com/217#entry217comment</comments>
      <pubDate>Sun, 1 Dec 2024 17:39:20 +0900</pubDate>
    </item>
    <item>
      <title>9월 PS 일지</title>
      <link>https://stonejjun.tistory.com/216</link>
      <description>&lt;p data-ke-size=&quot;size16&quot;&gt;따로 글을 쓰기에는 애매한 문제들이 있고, 그래도 풀이를 간단하게라도 정리하는 것이 필요해서, 다른 사람들의 방식을 빌려서 정리하려고 한다. 보통 플레 수준의 문제. 이번에는 8월 달에 문 문제도 일부 포함되어 있다.&lt;/p&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;BOJ 7036 Grazing on the Run&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;풀이&lt;/p&gt;
&lt;div data-ke-type=&quot;moreLess&quot; data-text-more=&quot;더보기&quot; data-text-less=&quot;닫기&quot;&gt;&lt;a class=&quot;btn-toggle-moreless&quot;&gt;더보기&lt;/a&gt;
&lt;div class=&quot;moreless-content&quot;&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;DP 향이 강하게 난다. 특히 파일 합치기 느낌으로 dp[i][j] = i~j 의 구간관리.&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;일단 첫번째로 구간 i~j 의 모든 건초를 먹었으면 위치 i또는 j에 있을 것이다. 따라서 [i][j][k] 에서 k로 최종적으로 i에 있는지 j에 있는지를 확인하자.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;dp[i][j][k]에 어떻게 값을 저장할 지가 핵심이다. 구간을 다 먹었을 때 최소치만을 고려하면, 지금까지 걸린 시간에 따라서 앞으로 먹을 건초가 달라지기 때문에 최소치,시간 페어를 고려해야 한다.&amp;nbsp;&lt;br /&gt;이는 사수아탕을 통해서 유명해진 테크닉으로 모든 건초의 부패량을 계산하면 된다. 즉 아직 먹지 못한 건초 수 * 걸린 시간 까지 더해서 관리 한다면 앞으로 부패할 값만 계산하면 되고, 완벽하게 관리할 수 있다.&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;후기&lt;/p&gt;
&lt;div data-ke-type=&quot;moreLess&quot; data-text-more=&quot;더보기&quot; data-text-less=&quot;닫기&quot;&gt;&lt;a class=&quot;btn-toggle-moreless&quot;&gt;더보기&lt;/a&gt;
&lt;div class=&quot;moreless-content&quot;&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;사수아탕을 푼 적이 있었기 때문에 딱히 어려울 게 없었다! 특히 DP면 뭐...&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;BOJ 18373 N!!!...! mod P&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;풀이&lt;/p&gt;
&lt;div data-ke-type=&quot;moreLess&quot; data-text-more=&quot;더보기&quot; data-text-less=&quot;닫기&quot;&gt;&lt;a class=&quot;btn-toggle-moreless&quot;&gt;더보기&lt;/a&gt;
&lt;div class=&quot;moreless-content&quot;&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;케이스 워크를 해야한다. 일단 N&amp;gt;=P 면 답은 0이다.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;그 외에 N=2 라면 답은 2이다. 또한 N=3일때 !을 하나 줄이고 N=6이라고 생각하자.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;N=4 이상일 때 N!! &amp;gt;5*`10^8 이기 때문에 !이 3개 붙는 순간 답은 0이고 따라서 우리는 4&amp;lt;=N&amp;lt;=13 인 N에 대해서 N!! Mod P의 값만 구하면 된다. 11! 의 값은 3991,6800이기 때문에 $O(N!)$으로 구할 수 있다. 하지만 12!의 값은 4,7900,1600 이기 때문에 다른 방법이 필요해 보인다...&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;구글신에 (p-1)! mod p 라는 것을 검색해보면 wilson's theorem을 볼 수 있다. 그 내용은 &lt;span style=&quot;background-color: #fafafa;&quot;&gt;(p-1)! mod p = -1이라는 것. 마침 13!의 값은 문제의 제한인 5,0000,0000과 굉장히 가깝기 때문에 (p-1)! 에서 역으로 구하는 것으로 문제를 해결할 수 있다.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;후기&lt;/p&gt;
&lt;div data-ke-type=&quot;moreLess&quot; data-text-more=&quot;더보기&quot; data-text-less=&quot;닫기&quot;&gt;&lt;a class=&quot;btn-toggle-moreless&quot;&gt;더보기&lt;/a&gt;
&lt;div class=&quot;moreless-content&quot;&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;레전드 문제 제한을 볼 수 있었다. 친구들의 도움을 받아서 케웍을 했고, 구글의 도움을 받아 윌슨을 알아냈다... 윌슨을 얻어갈 수 있었던 문제&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;BOJ 8872 빌라봉&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;풀이&lt;/p&gt;
&lt;div data-ke-type=&quot;moreLess&quot; data-text-more=&quot;더보기&quot; data-text-less=&quot;닫기&quot;&gt;&lt;a class=&quot;btn-toggle-moreless&quot;&gt;더보기&lt;/a&gt;
&lt;div class=&quot;moreless-content&quot;&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;문제를 읽으면 대충 중앙 쯤에서 연결해야 겠다는 생각을 할 수 있고, 트리에서 모든 점 까지의 거리의 최댓값이 최소인 어떤 점을 잘 잡아야 겠다는 생각을 할 수 있다. 당연히 다른 트리와 연결할 점은 고른 그 점이 될 것이다. 고른 점에서 &lt;span style=&quot;background-color: #fafafa;&quot;&gt;모든 점 까지의 거리의 최댓값을 트리의 반지름이라고 하자.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #fafafa;&quot;&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;background-color: #fafafa;&quot;&gt;&amp;nbsp;일단 반지름이 가장 큰 트리의 중심에에 스타 형태의 트리 같이 다른 모든 트리를 붙여야 겠다는 생각을 할 수 있다. 처음에는 그러면 정답이 반지름이 가장 큰 트리의 반지름 + &lt;span style=&quot;background-color: #fafafa;&quot;&gt;반지름이 두 번째로 큰 트리의 반지름 + L: 일것이라고 생각을 했으나 트리의 지름 중 최댓값, 혹은 2번째 반지름+ 3번째 반지름 + 2*L 도 답이 될 수 있다.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;background-color: #fafafa;&quot;&gt;&amp;nbsp;반지름을 구하는 방법은 정말 다양하다. 그 중에서 내가 생각한 방법은 꽤나 좋은 방식이라고 생각한다. 일단 트리의 중심(&lt;span style=&quot;background-color: #fafafa;&quot;&gt;모든 점 까지의 거리의 최댓값이 최소인 어떤 점&lt;/span&gt;) 이 트리의 지름 경로 위에 있다는 것을 알아야 한다. 그렇다면 트리의 지름의 양끝점에서 각각 다른 모든 점까지의 거리를 구한 뒤, 그 두 거리중 최댓값이 최소인 점을 찾으면 된다. 또한 그 값이 트리의 반지름이 된다. 이는 &lt;a href=&quot;https://stonejjun.tistory.com/149&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stonejjun.tistory.com/149&lt;/a&gt;&amp;nbsp;와 비슷한 느낌으로 값이 올바르다는 것을 알 수 있다.&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;background-color: #fafafa;&quot;&gt;&amp;nbsp;결국 각 트리별로 dfs를 몇번씩 돌리고 반지름과 지름 값 들을 잘 비교해서 계산해주면 된다.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;후기&lt;/p&gt;
&lt;div data-ke-type=&quot;moreLess&quot; data-text-more=&quot;더보기&quot; data-text-less=&quot;닫기&quot;&gt;&lt;a class=&quot;btn-toggle-moreless&quot;&gt;더보기&lt;/a&gt;
&lt;div class=&quot;moreless-content&quot;&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;답이 될 가능성이 있는 값의 후보를 모두 고려하는 과정에서 실수하기 쉬운 문제라고 생각한다.&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;BOJ 14749 Grasshopper Route&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;풀이&lt;/p&gt;
&lt;div data-ke-type=&quot;moreLess&quot; data-text-more=&quot;더보기&quot; data-text-less=&quot;닫기&quot;&gt;&lt;a class=&quot;btn-toggle-moreless&quot;&gt;더보기&lt;/a&gt;
&lt;div class=&quot;moreless-content&quot;&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;background-color: #fafafa;&quot;&gt;트리이기 때문에 편하게 생각하기 위해서 루트를 잡아야 한다. 이 문제와 같은 경우는 일단 루트를 시작점으로 잡아보자.&amp;nbsp; 그렇다면 자식들을 루트로 하는 서브트리가 있을 것이다. 그 서브트리 중에는 목적지가 하위노드로 있는 서브트리도 있을 것이다.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #fafafa;&quot;&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;background-color: #fafafa;&quot;&gt;&lt;br /&gt;&amp;nbsp;그렇다면 방문하는 순서는 목적지가 마지막이어야 하기 때문에 목적지가 하위노드로 있는 서브트리를 마지막으로 들어가야 할 것이다. 이와 별개로 방문은 어떻게 해야할까? 서브트리의 모든 노드를 탐색할 때 할 수 있는 방식은 두가지이다. 서브트리의 루트를 시작할 때 탐색하기, 혹은 마지막에 탐색하기.&amp;nbsp;&lt;br /&gt;&amp;nbsp;어떤 서브트리의 루트를 시작할 때 탐색했을 때, 그 자식들을 루트로 하는 서브트리는 루트를 마지막으로 탐색하는 방식을 선택하면 거리 3안에 서브트리의 노드를 탐색할 수 있다. 다른 방식으로는 노드의 레벨을 홀짝으로 나눠서 홀수 레벨은 내려가면서 탐색하고 짝수 레벨은 올라가면서 탐색하면 같은 결과를 얻을 수 있을 것이다.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;후기&lt;/p&gt;
&lt;div data-ke-type=&quot;moreLess&quot; data-text-more=&quot;더보기&quot; data-text-less=&quot;닫기&quot;&gt;&lt;a class=&quot;btn-toggle-moreless&quot;&gt;더보기&lt;/a&gt;
&lt;div class=&quot;moreless-content&quot;&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;stations 라는 문제에서 영감을 얻을 수 있었다.&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;BOJ 25095 Weightlifting&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;풀이&lt;/p&gt;
&lt;div data-ke-type=&quot;moreLess&quot; data-text-more=&quot;더보기&quot; data-text-less=&quot;닫기&quot;&gt;&lt;a class=&quot;btn-toggle-moreless&quot;&gt;더보기&lt;/a&gt;
&lt;div class=&quot;moreless-content&quot;&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;background-color: #fafafa;&quot;&gt;DP를 하는 문제이다. 딱봐도. 구간 DP를 해야할 것처럼 보이는데 중요한건 재귀 DP를 해야하는 것이다.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;background-color: #fafafa;&quot;&gt;prefix 를 이용하여 미리 구간에 대해서&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;후기&lt;/p&gt;
&lt;div data-ke-type=&quot;moreLess&quot; data-text-more=&quot;더보기&quot; data-text-less=&quot;닫기&quot;&gt;&lt;a class=&quot;btn-toggle-moreless&quot;&gt;더보기&lt;/a&gt;
&lt;div class=&quot;moreless-content&quot;&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;codejam 때는 못풀었다...&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;&amp;nbsp;&lt;/h3&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;지속적으로 갱신 중입니다...&lt;/h3&gt;</description>
      <category>코딩/코딩 이모저모</category>
      <author>stonejjun</author>
      <guid isPermaLink="true">https://stonejjun.tistory.com/216</guid>
      <comments>https://stonejjun.tistory.com/216#entry216comment</comments>
      <pubDate>Mon, 19 Sep 2022 14:42:10 +0900</pubDate>
    </item>
    <item>
      <title>SCPC 2022 본선 후기</title>
      <link>https://stonejjun.tistory.com/215</link>
      <description>&lt;h3 style=&quot;text-align: left;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;Chap 0. Prologue&lt;/b&gt;&lt;/h3&gt;
&lt;p style=&quot;text-align: left;&quot; data-ke-size=&quot;size16&quot;&gt;2차 예선에서 탈락의 고배를 마신 작년과 달리 올해는 본선에 진출할 수 있었다. 그렇기 때문에 더욱더 상이 간절해졌다. 5등상이기만 해도 부수적으로 얻을 수 있는 것들이 많았기 때문에 SCPC 수상이 정말 간절했다. 올해의 CP 3대 목표는 scpc 수상, icpc 월파 진출, 코포 레드 달성이다.&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1124&quot; data-origin-height=&quot;658&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/UGzJ7/btrMktV7LnV/F18QsrTEOhNmklb4O7f0tk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/UGzJ7/btrMktV7LnV/F18QsrTEOhNmklb4O7f0tk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/UGzJ7/btrMktV7LnV/F18QsrTEOhNmklb4O7f0tk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FUGzJ7%2FbtrMktV7LnV%2FF18QsrTEOhNmklb4O7f0tk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1124&quot; height=&quot;658&quot; data-origin-width=&quot;1124&quot; data-origin-height=&quot;658&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot; data-ke-size=&quot;size16&quot;&gt;예선은 굉장히 나답게 통과했다. 4번은 힘을 들이지 않고 풀이가 생각났는데 3번은 죽어도 풀이가 안떠올랐다... 불안해서 열심히 긁었고, 안정적으로 본선에 진출할 수 있었다.&lt;/p&gt;
&lt;h3 style=&quot;text-align: left;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;Chap 1. 본선 준비&lt;/b&gt;&lt;/h3&gt;
&lt;p style=&quot;text-align: left;&quot; data-ke-size=&quot;size16&quot;&gt;icpc ucpc와 scpc의 차이는 무엇일까. 첫째로 개인대회라는 것이고 둘째로 팀 노트가 없다는 것이다. 그렇다면 코포와 scpc의 차이는? 검색이 안된다는 것이다. 그렇다. 모든 코드를 다 머릿속에만 의존해서 짤 줄 알아야 한다.&lt;br /&gt;&lt;br /&gt;특히 scpc는 문자열을 굉장히 좋아한다는 소문이 있다. 하지만 나는 문자열을 등지고 살았었기에 이번 기회에 겸사겸사라는 생각으로 해싱, 마나커, kmp, 트라이를 공부했고, 추가로 이분 매칭, 디닉, hld, centroid 등을 공부하고 코드를 암기했다.&lt;br /&gt;&lt;br /&gt;남은 건 아호코라식과 SA였고 작년 문제를 생각했을 때 꼭 ㅁ외워가야 하는 것이라고 생각했지만, 대회 전날 커피를 마시고 집중도 못해서 공부도 못하고 새벽 4시 30분에 자버렸다...&lt;/p&gt;
&lt;h3 style=&quot;text-align: left;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;Chap 2. 무난한 출발...?&lt;/b&gt;&lt;/h3&gt;
&lt;p style=&quot;text-align: left;&quot; data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;1번 문제를 읽고 천천히 생각을 했다. 딱 보니까 최적의 구간은 양 끝 점을 포함하는 구간이거나, 양 끝 점에 극한으로 다가가서 포함을 하지 않는 구간 둘 중 하나였다. 따라서 n^2개의 구간 중 가장 좋은 구간을 찾으면 된다.&lt;br /&gt;&amp;nbsp;이런 문제 특, 답이 될 만한 $O(N)$ 개의 구간만 보면 된다. 각 점마다 1/n의 가중치를 가지고 있다고 가면, 이동하는 만큼 감소가 되고 하나를 먹을 때마다 1/n 이 증가한다. 그래서 모든 점을 1/n - 이전 점까지의 거리라는 값으로 바꾸면 배열에서 가장 큰 부분합을 구하는 문제와 비슷하게 되고, 이는 쉽게 해결할 수 있다.&lt;br /&gt;근데 WA를 받았다. 큰 충격과 불안에 휩싸였지만, 풀이는 틀리지 않았을 것이라는 믿음을 가지고 코드를 보니 cout precision을 안 한 것을 확인할 수 있었다. 근데 내가 까먹었는지 precision이 잘 안 되었다. 그래서 printf %. 12f로 제출했더니 맞았다.&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot; data-ke-size=&quot;size16&quot;&gt;+34 1번 100점&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot; data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;이후 2번을 봤는데 보자마자 $O(N^3)$ DP 가 떠올랐고, 30초 있다가 DNC OPT가 떠올랐다. 하지만 섣부르지 않기 위해서 열심히 종이를 잡았고, DNC OPT를 적용할 수 있다는 사실을 확인할 수 있었다. 따라서 바로 코딩을 시작했고, 결과는 WA... 혹시나 해서 OPT 부분을 없애고 $O(N^3)$ DP를 짜니까 바로 47점을 얻을 수 있었다.&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot; data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;이때가 시작 후 50분 시점이었기 때문에 아직 2번을 보는 것이 맞다고 판단. 2차원에서 가로 세로 OPT가 아닌 대각선 한 줄 별로 DNC를 실시하였다. 결과는 똑같이 WA... 나는 큰 충격에 휩싸였고, 이후 패닉 제출을 여러 번 했지만, 결과는 똑같았다. &lt;br /&gt;시점은 90분이 지났고, 점수는 147점. 풀이는 틀렸을 리가 없었지만, 2번 문제의 10번의 제출로 페널티는 꽤나 쌓인 상태였다. 무난하다고 볼 수도 있지만, 뭔가 께름칙한 시작이었다.&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot; data-ke-size=&quot;size16&quot;&gt;+53 2번 47점&lt;/p&gt;
&lt;h3 style=&quot;text-align: left;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;Chap 3. 훌륭한 중반&lt;/b&gt;&lt;/h3&gt;
&lt;p style=&quot;text-align: left;&quot; data-ke-size=&quot;size16&quot;&gt;이후 3번으로 보고 좀 생각을 해보다가 던졌다. 그리고 4번을 봤다... 어? 보자마자 드는 생각은 DP나 파라매트릭. 그리고 문제를 읽으면서 당연하게 같은 숫자는 붙어있는 것이 이득이라고 생각하였다. 또한 정답에 카운트되는 메인, 정답에 카운트되지 않는 깔개로 잘 분리를 하면 전체 답은 전체 개수 - 깔개 수 인데, i번째 수까지 k개의 깔개가 생겼을 때로 잘 DP를 하면 되지 않을까라는 생각을 했다.&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot; data-ke-size=&quot;size16&quot;&gt;(메인 2222222) (깔개 1) (메인 333333) (깔개 3) (메인 4)&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot; data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;이후 손으로 좀 굴려보니까 많은 숫자 뭉치는 위쪽에 있는 게 이득이고, 작은 수부터 보면 굉장히 편하다는 사실을 확인했다. 다음 수가 들어갈 때 더 큰 수가 들어오기 때문에, 깔개가 부족하면 그냥 메인으로 있던 수 중에 하나를 깔개로 끌고 와서 내리면 그만이었다. &lt;br /&gt;&amp;nbsp;여기서 Touch the Sky라는 문제가 생각났고, PQ를 관리하면서 그리디를 하는 방식이 떠올랐다. 하나의 메인 뭉치를 다 깔개로 내리면 뭉치가 하나 줄어서 깔개를 하나 덜 써도 되기 때문에 무조건 이득이라고 생각했다.&lt;br /&gt;&amp;nbsp;위의 상황을 예시로 들자면 다음에 5 2개가 들어오는데, 메인&amp;gt;깔개 이므로, 깔개로 하나를 내려야 한다. 이때 항상 메인 중 하나를 내릴 수 있으며 4를 내리는 게 이후 상황에서 무조건 이득이다.&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot; data-ke-size=&quot;size16&quot;&gt;1. (메인 2222222) (깔개 1) (메인 33333) (깔개 3) (메인 4) (깔개 3) (메인 55)&lt;br /&gt;2. (메인 2222222) (깔개 1) (메인 333333) (깔개 3) (메인 55) (깔개 4)&lt;br /&gt;2번의 경우에만 다음에 오늘 k개를 바로 정답에 카운트되는 메인으로 보낼 수 있다.&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot; data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;그럼 pq로 뭉치 크기가 작은 순서로 관리하면서 메인 뭉치 개수와 깔개 개수를 비교하면서 스위핑 하면 된다. &lt;br /&gt;그리고 이 모든 과정을 7분 만에 마무리하였다. 그래서 코딩을 다 했더니 경과 시간은 107분에 4번 문제를 푼 사람은 x. 내가 생각하기에 4번은 잡으면 풀 수 있는 사람이 너무 많다고 생각하여 4번을 안 내고 3번을 잡는 선택지를 했다. &lt;br /&gt;&amp;nbsp;3번에서 (log 범위)^2 이 필요한 38점짜리 풀이를 거의 만들어 가고 있는데 4번 문제의 정답자가 나와있었다. 그래서 얼른 제출을 했더니... WA? 그래서 내 풀이를 검토했다. 사실 엄청 어려운 문제인데 내가 사풀을 낸 것이 아닐까 무척 두려웠다. 하지만 풀이를 검토했더니 틀린 부분이 없어 코드를 검토했고, 1 이상이면 pq에 넣는 것을 1초과일 때 넣는 것으로 구현했다는 것을 발견할 수 있었다. 그리고... 결과는 AC!&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot; data-ke-size=&quot;size16&quot;&gt;+142 4번 100점&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot; data-ke-size=&quot;size16&quot;&gt;완벽한 순간이었고, 수상은 확정 지었다고 생각했다. 이제 2번 100점과 3번 38점을 받으면 꽤나 높은 상을 탈 수 있다는 기대감이 생겼다.&lt;/p&gt;
&lt;h3 style=&quot;text-align: left;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;Chap 4. 다소 아쉬운 마무리&lt;/b&gt;&lt;/h3&gt;
&lt;p style=&quot;text-align: left;&quot; data-ke-size=&quot;size16&quot;&gt;3 번은 38점 풀이는 그렇게 어렵지는 않았다. 근데 구현이 생각보다 많이 까다로웠다. 156분에 첫 제출을 해서 182분 까지 11번의 WA를 받았다. 하지만 나는 남들과 다른 거의 유일한 점수인 상황이었기 때문에 (이때도 4번 솔브 수 2~3) 페널티 경쟁은 할 일이 없다고 생각했다. 그렇게 왜 틀렸는지 모든 수를 찍어봤는데 100까지 모두 잘 나왔다. 그래서 다시 문제를 읽어봤더니 0에서 이상한 결과를 출력하고 있다는 것을 깨달았다. 이후 바로 예외처리를 해서 38점을 받을 수 있었다.&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot; data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;마지막으로 2번에 달려들었다. 1시간 동안 다양한 dnc OPT와 추한 뚫기 코드를 이용해서 20번을 넘게 제출했지만 얻게 된 것은 페널티뿐이었다. 끝나고 들어 보니 2번은 dnc opt가 안 되는 문제였다... 나는 무엇을 증명하였는가.&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot; data-ke-size=&quot;size16&quot;&gt;+184 3번 38점&lt;br /&gt;총결과 285점. - 100 47 38 100 0&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1153&quot; data-origin-height=&quot;375&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/cPcEc2/btrMy2QWjCS/V0ywksaguAtimaVNOeB3yK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/cPcEc2/btrMy2QWjCS/V0ywksaguAtimaVNOeB3yK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/cPcEc2/btrMy2QWjCS/V0ywksaguAtimaVNOeB3yK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcPcEc2%2FbtrMy2QWjCS%2FV0ywksaguAtimaVNOeB3yK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1153&quot; height=&quot;375&quot; data-origin-width=&quot;1153&quot; data-origin-height=&quot;375&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h3 style=&quot;text-align: left;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;Chap 5. After story.&lt;/b&gt;&lt;/h3&gt;
&lt;p style=&quot;text-align: left;&quot; data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;끝나고 내 위에 있는 사람들을 열심히 찾아다녔다. 처음에는 4등~5등상 을 생각했으나, 생각보다 내 위에 사람이 없었고, 혹시 3등상? 이라는 마음이 생겼다. 그렇게 수소문한 결과 내 위에 정확히 8명을 찾을 수 있었다... 특히 그 중 내가 아는 최저점은 100 100 88 0 0 의 288점이었다. 진짜로 3점차이로 4등상이면 너무 억울할 것 같아서 288 이 차라리 훨씬 많거나, 내가 들은 사람중 더 이상 상을 탈 수 없는 사람이 있어 정확히 8등으로 3등상 막차를 타기를 간절히 바랐다.&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot; data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;17일에 결과가 공지된다는 문자가 오기 전까지 매일 간절한 마음으로 SCPC 홈페이지에 접속했다. 시작 전에는 5등상만 받아도 된다더니 행동은 달랐다.(ㅎㅎ) 사실 머릿속으로는 이미 4등상일걸 알면서도 혹시나 하는 마음에 계속 기대를 하지 않을 수 없었다. 사실 이미 모든 증언에 의해 4등상 이하가 확실시되어있는 상황이긴 했는데도 좀 많이 기대한 것 같기도 하다.&lt;/p&gt;
&lt;h3 style=&quot;text-align: left;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;Chap 6. 시상식과 상자 안의 고양이&lt;/b&gt;&lt;/h3&gt;
&lt;p style=&quot;text-align: left;&quot; data-ke-size=&quot;size16&quot;&gt;드디어 시상식 날 아침이 되었고, ifland에 들어가서 자리에 앉은 후 기다렸다. 5등상을 보고서 가나다 순으로 나온다는 것을 확인했고, 4등상의 두 번째 페이지를 봤는데...&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1339&quot; data-origin-height=&quot;631&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/QdiVo/btrMxUd8nq8/SWG0EkNphlrPfpBiDJkdKk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/QdiVo/btrMxUd8nq8/SWG0EkNphlrPfpBiDJkdKk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/QdiVo/btrMxUd8nq8/SWG0EkNphlrPfpBiDJkdKk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FQdiVo%2FbtrMxUd8nq8%2FSWG0EkNphlrPfpBiDJkdKk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1339&quot; height=&quot;631&quot; data-origin-width=&quot;1339&quot; data-origin-height=&quot;631&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot; data-ke-size=&quot;size16&quot;&gt;나의 이름을 확인할 수 있었다. 막상 이렇게 되니까 아쉬웠지만, 한편으로는 후련했다. 결국 해냈고, 수상이라는 목표는 이루어 냈기 때문에! 사실 이미 마음속으로도 어느 정도 예상을 했는지 막상 마주해도 막 큰 타격보다는 후련함과 행복감이 더 컸던 것 같다.&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot; data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;끝나고 나서... 나에게 택배로 고양이 상자가 하나 다가왔다. 그 상자 안의 고양이는 살아있으면서 죽어있었다. 그렇다면 나는 고양이가 살아있기도 하니까 잊고 행복하게 살아갈 수도 있었다. 하지만 그럴 수 없었다. 언젠가는 상자를 열게 될 것이었고, 사실 궁금함을 참지 못하는 나에게 그 언젠가는 바로 당장이었으니까. &lt;br /&gt;바로 링크를 타고 들어가 점수 순으로 개제 되어있는 홈페이지에 표시되어있는 결과를 확인했다. 결과는...&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1140&quot; data-origin-height=&quot;450&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/chegdh/btrMqtvD1sP/ncENTMAkKFzGICFU42ST41/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/chegdh/btrMqtvD1sP/ncENTMAkKFzGICFU42ST41/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/chegdh/btrMqtvD1sP/ncENTMAkKFzGICFU42ST41/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fchegdh%2FbtrMqtvD1sP%2FncENTMAkKFzGICFU42ST41%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1140&quot; height=&quot;450&quot; data-origin-width=&quot;1140&quot; data-origin-height=&quot;450&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot; data-ke-size=&quot;size16&quot;&gt;캬~~ 당당한 4등상 첫자리!!!! 와~~~ 고양이는 깔끔하게 죽어있었고, 상자 안에 남아있던 독가스가 퍼져서인지 몰라도 나까지도 어질어질했다. 여기저기 하소연을 하면서 마음을 가라앉혔다. 장난 삼아 윗사람 탓도 해보고, 나보다 잘 본 사람을 가르쳐준 사람 탓도 해보고, 문제 배점 탓도 해보고 했지만, 다 농담이었다. 왜냐면 그냥 내가 좀 만 더 잘했으면 되는 거니까. &lt;br /&gt;그렇게 매 대회에서 한 등수 올라가거나 떨어지면 상이 바뀌는 나의 줄타기는 변하지 않았음을 확인할 수 있었다.&lt;/p&gt;
&lt;h3 style=&quot;text-align: left;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;Chap 7. Epilogue - Story of stonejjun03&lt;/b&gt;&lt;/h3&gt;
&lt;p style=&quot;text-align: left;&quot; data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;이번 대회는 본선도 예선도 누구보다 나 답게 해냈다. 예선 2차는 3번 대신 4번을 풀어냈고, 본선에서는 30명 넘게 푼 2번을 못 풀고 6명만이 푼 4번을 가볍게 풀어냈다.&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot; data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;사실 최근 1년간 마음고생이 굉장히 심했다. 성과는 잘 안 나오고 있고, 그냥 내 실력에 내가 만족스럽지도 않았고, 사실 나 스스로 내가 정말 열심히 한다는 생각조차 들지 않았다. 코딩이 재미없었고, 하기 싫은 느낌이 강했다.&lt;br /&gt;&amp;nbsp;그래서 마음을 더 독하게 먹었다. 잘하는 사람에게 찾아가 쓴소리를 듣고, 남들과 비교해서 3일 정도 자극받아 열심히 하고, 다른 사람 붙잡아서 관리해달라고 하면서 한 두 달 열심히 하고, 마치 카드 돌려막기를 하는 것처럼 어떻게든 외부에서 요인을 만들어서 나를 더 구석에 몰아넣었다. 나는 그래야 하기 싫은 걸 열심히 하는 사람이라서.&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot; data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;사실 코딩이 막 그렇게 싫은 건 아니었다. 하지만, 내가 정말 부족한 능력을 기르기 위해서는, 내가 원하는 대회에서 안정적인 성과를 거두는 사람이 되기 위해서는 조금은 하기 싫은 공부를 해야 되는 상황이었다.&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot; data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;근데 막상 하다 보니까 할만했다. 무엇보다 정말 좋은 성과를 내고 싶고 잘하는 사람이 되고 싶다는 간절함이 컸던 것 같다. 같이 버츄얼 돌고, 플레 몇십 문제 박아다가 조금씩 해결하고, 매일 코딩에 일정 시간을 쏟고, 나에 대해서 분석하고, 무슨 문제던지 끝까지 마무리 짓는 것들. 막상 습관처럼 되니까 해 볼만 했다. &lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot; data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;작년의 나와 비교하면 확실히 늘었다고 말할 수 있는 것 같다. 저점은 올랐고, 고점의 폭도 증가했다. 고점의 폭? 이라고 하면 약간 이상하지만 최근에 어떤 대회를 치더라도 나한테 정말 잘 맞는 (그래서 남들과 차별 점으로 이득을 가져올 수 있는) 문제가 하나씩은 매 대회에서 보였다.&lt;br /&gt;&amp;nbsp;하지만 아직 그 한 문제를 쉽게 푸는 것을 온전히 이득으로 가져오지는 못하는 것 같다. 이번 2번 같은 문제를 안정적으로 풀 정도는 되어야 더 한 단계 나아갈 수 있을 것이다. &lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot; data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;이렇게 블로그에 이런 이야기를 푸는 것은 처음인 것 같다. 오랜 생각이어서 그런지 글이 술술 써졌다. 지금까지 도움을 주신 많은 분들께 감사하다는 말을 하고 싶다. 그리고 이 글을 보는 많은 (? 어쩌면 적은) 사람들에게 더 나아갈 것이라는 다짐을 하려고 한다. &lt;br /&gt;&lt;br /&gt;지금까지 후기로 시작하여 저의 이야기로 끝난 글을 읽어주셔서 감사합니다.&lt;/p&gt;</description>
      <category>일상/대회 참가 후기</category>
      <author>stonejjun</author>
      <guid isPermaLink="true">https://stonejjun.tistory.com/215</guid>
      <comments>https://stonejjun.tistory.com/215#entry215comment</comments>
      <pubDate>Sat, 17 Sep 2022 11:22:17 +0900</pubDate>
    </item>
    <item>
      <title>BOJ 8189 - Antisymmetry</title>
      <link>https://stonejjun.tistory.com/214</link>
      <description>&lt;p data-ke-size=&quot;size16&quot;&gt;문제 링크 : &lt;a href=&quot;https://www.acmicpc.net/problem/8189&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://www.acmicpc.net/problem/8189&lt;/a&gt;&lt;/p&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;문제 풀이&lt;/b&gt;&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;일단 문제를 보면 몇 가지 사실들을 알 수 있다. 첫 번째로 답이 가능한 길이는 짝수이다. 좀 더 생각해보면 답이 가능할 조건을 다른 방법으로도 판단할 수 있다고 생각할 수 있다. 예를 들면 반으로 접었을 때 만나는 두 원소의 합이 모두 1일 때 Antisymmetry이다.&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;중요한 것은 1010101010... 과 같은 경우에 답의 스케일이 $O(N^2)$이기 때문에, 답의 개수를 하나하나 구하는 것은 불가능하다고 판단할 수 있으며, 따라서 (어떠한 조건의 ) 문제에서 구하고자 하는 구간의 개수를 한번에 구함으로서 문제를 해결하는 쪽으로 방향을 잡을 수 있다.&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;보통 구간과 같은 경우에는 동일한 시작점 혹은 끝점으로 묶지만, 이번의 경우에는 구하고자 하는 구간의 특성상 가운데 지점을 잡을 수 있다. 이렇게 묶으면 여러가지를 관찰할 수 있다. 특히 위치 $x$를 기준으로 길이 2k가 문제를 만족한다면 $0&amp;lt;i&amp;lt;k$ 인 모든 $i$에 대해서 $x$를 기준으로 길이가 2i인 구간은 문제의 조건을 만족한다.&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;여기까지 관찰 되었으면 문자열에서 팰린드롬의 개수를 구하는 문제가 떠오를만 하다. 그렇다면 자연스럽게 manacher's algorithm이 생각나게 된다. 이를 감안하고 다시 문제의 조건을 확인한다면 &lt;span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;특히 위치 $x$를 기준으로 길이 2k인 구간이 문제를 만족할 때 왼쪽 부분의 일부가 만족한다면 대칭인 오른쪽 부분의 일부도 똑같이 문제의 조건을 만족한다는 것을 알 수 있다. (0101) 이 만족하면 (1010) 도 만족한다. 따라서 마나커 알고리즘을 완벽히 똑같이 적용시키면 된다는 것을 알 수 있다.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;&lt;span&gt;코드&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #f0f0f0; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #272727; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #4f4f4f;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #aaa; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;25&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;26&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;27&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;28&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;29&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;30&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;31&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;32&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;33&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;34&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;35&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;36&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;37&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;38&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;39&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;40&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;41&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;42&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;43&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;44&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;45&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;46&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;47&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;48&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;49&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;50&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;51&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;52&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;53&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;54&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;55&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;56&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;57&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;58&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;59&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;60&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;61&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;62&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;63&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;64&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;65&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #f0f0f0; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#include&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;bits&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;/&lt;/span&gt;stdc&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;.h&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;using&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;namespace&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;std&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;typedef&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;long&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;long&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;int&lt;/span&gt;&amp;nbsp;ll;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;typedef&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;long&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;double&lt;/span&gt;&amp;nbsp;dl;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;typedef&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;pair&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;dl,dl&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;pdi;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;typedef&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;pair&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;ll,ll&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;pii;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;typedef&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;pair&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;ll,pii&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;piii;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;ff&amp;nbsp;first&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;ss&amp;nbsp;second&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;eb&amp;nbsp;emplace_back&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;ep&amp;nbsp;emplace&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;pb&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;push_back&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;mp&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;make_pair&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;all(x)&amp;nbsp;(x).&lt;span style=&quot;color: #4be6fa;&quot;&gt;begin&lt;/span&gt;(),&amp;nbsp;(x).&lt;span style=&quot;color: #4be6fa;&quot;&gt;end&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;compress(v)&amp;nbsp;sort(all(v)),&amp;nbsp;v.erase(unique(all(v)),&amp;nbsp;v.&lt;span style=&quot;color: #4be6fa;&quot;&gt;end&lt;/span&gt;())&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;IDX(v,&amp;nbsp;x)&amp;nbsp;lower_bound(all(v),&amp;nbsp;x)&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;-&lt;/span&gt;&amp;nbsp;v.&lt;span style=&quot;color: #4be6fa;&quot;&gt;begin&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;//cout&amp;lt;&amp;lt;fixed;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;//cout.precision(12);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;struct&lt;/span&gt;&amp;nbsp;poi{&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ll&amp;nbsp;val,xx,yy;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;};&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #4be6fa;&quot;&gt;vector&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;ll&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;v;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;ll&amp;nbsp;n,m;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;ll&amp;nbsp;mod&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;998244353&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #4be6fa;&quot;&gt;string&lt;/span&gt;&amp;nbsp;s;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #4be6fa;&quot;&gt;string&lt;/span&gt;&amp;nbsp;t;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;ll&amp;nbsp;arr[&lt;span style=&quot;color: #c10aff;&quot;&gt;1010101&lt;/span&gt;];&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;ll&amp;nbsp;ans&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;ll&amp;nbsp;val[&lt;span style=&quot;color: #c10aff;&quot;&gt;1010101&lt;/span&gt;];&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;ll&amp;nbsp;mx,cen;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #4be6fa;&quot;&gt;int&lt;/span&gt;&amp;nbsp;main(){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ios_base::sync_with_stdio(&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;cin&lt;/span&gt;.tie(&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ll&amp;nbsp;a,b,c,d,i,j,k,p,q;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;cin&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;n&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;s;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;for&lt;/span&gt;(i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;n;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arr[i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;s[i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #ffd500;&quot;&gt;'0'&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;n&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;*&lt;/span&gt;n&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;for&lt;/span&gt;(i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;2&lt;/span&gt;;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;n;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;2&lt;/span&gt;){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;if&lt;/span&gt;(i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;mx){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;val[i]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;min(val[&lt;span style=&quot;color: #c10aff;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;*&lt;/span&gt;cen&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;-&lt;/span&gt;i],mx&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;-&lt;/span&gt;i);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;else&lt;/span&gt;&amp;nbsp;val[i]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;//cout&amp;lt;&amp;lt;mx&amp;lt;&amp;lt;'&amp;nbsp;'&amp;lt;&amp;lt;i&amp;lt;&amp;lt;'&amp;nbsp;'&amp;lt;&amp;lt;val[i]&amp;lt;&amp;lt;'\n';&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;while&lt;/span&gt;((arr[i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;-&lt;/span&gt;val[i]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;2&lt;/span&gt;]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;arr[i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;val[i]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;2&lt;/span&gt;])&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;-&lt;/span&gt;val[i]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;amp;&lt;/span&gt;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;val[i]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;n){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;val[i]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;2&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;if&lt;/span&gt;(mx&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;val[i]){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mx&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;val[i];&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;cen&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;i;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;//cout&amp;lt;&amp;lt;i&amp;lt;&amp;lt;'&amp;nbsp;'&amp;lt;&amp;lt;val[i]&amp;lt;&amp;lt;'\n';&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ans&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;(val[i]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;)&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;2&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;cout&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;ans;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: right; margin-top: -13px; margin-right: 5px; font-size: 9px; font-style: italic;&quot;&gt;&lt;a style=&quot;color: #4f4f4ftext-decoration:none;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #4f4f4f; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;</description>
      <category>코딩/백준 문제 풀이</category>
      <author>stonejjun</author>
      <guid isPermaLink="true">https://stonejjun.tistory.com/214</guid>
      <comments>https://stonejjun.tistory.com/214#entry214comment</comments>
      <pubDate>Fri, 16 Sep 2022 01:23:02 +0900</pubDate>
    </item>
    <item>
      <title>BOJ 19265 - Is it a p-drome?</title>
      <link>https://stonejjun.tistory.com/213</link>
      <description>&lt;p data-ke-size=&quot;size16&quot;&gt;문제 링크 :&amp;nbsp;&lt;a href=&quot;https://www.acmicpc.net/problem/19265&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://www.acmicpc.net/problem/19265&lt;/a&gt;&lt;/p&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;문제 풀이&lt;/b&gt;&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;이 문제는 배열 p에 존재한 모든 $p_i$에 대해서 $T_i = Tp_i $ 인지를 S의 모든 구간에 T에 대해서 확인하는 문제이다.&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;여기서 어떤 형태를 비교하는 거니까 문자열 매칭과 비슷한 느낌을 받을 수 있다. 먼저 생각난 것은 KMP 였지만 KMP로는 풀 수 없는 형태였다. 실패함수가 좋은 형태로 나타나지 않기 때문에 KMP는 포기할 수 밖에 없었다.&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;이 상태에서 문제를 푸는 사고의 흐름이었다면 라빈-카프 해싱을 생각을 했어야 했다. $T_i = Tp_i $ 라는 것은 i 기반 해싱값과 pi 기반 해싱값이 같다는 거고, 좀 만 더 생각하고 식을 변형 시켜 보면 $\sum_{i}^{} i\times T_i = \sum_{i}^{} p_i\times T_i$ 이어야만 구간이 문제 조건을 만족한다는 것을 알 수 없다. 하지만 이 식을 만족해도 문제 조건을 만족한다는 보장이 없기 때문에 $ \sum_{i}^{} A_i\times i\times T_i = \sum_{i}^{}A_i\times p_i\times T_i $ 의 식으로 확장시켜서 생각할 수 있고, 이 식에서는 $A_i$ 라는 변수를 추가되었고 이를 마음대로 변형시켜서 여러 번 확인하는 것을 할 수 있다.&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;하지만 문제가 있다. S의 모든 길이 m의 부분 구간 T에 대해서 위의 식의 좌변 과 우변의 값을 계산해야 한다. 이때 T의 길이가 m이며 sliding 한 형태로 존재한다는 것을 이용하여 FFT를 떠올릴 수 있다. T에 곱해질 값을 순서를 뒤집은 다음에 두 다항식을 곱하게 되면 위의 한 쪽 변이 곱해진 다항식의 한 항의 계수로써 등장하게 된다. 따라서 $O(N^2)$ 이 아닌 $O(NlgN)$ 에 문제를 해결 할 수 있다.&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;나는 해싱을 생각을 못했기 때문에 FFT 라는 단어를 힌트로 들었고, 조건을 다른 형태의 식으로 바꾸었다. &lt;span&gt;$ \sum_{i}^{} A_i\times T_i = 0 $&lt;span&gt; 를 확인할 건데 $A_i$&amp;nbsp; 를 구성할 때&amp;nbsp; &lt;span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;$A_i$ 에 k를 더하고 &lt;span&gt;$A_pi$ 에 -k를 하는 것을 무작위 적으로 반복하면 위의 식을 만족해야 문제의 조건을 만족한다고 할 수 있다. 이를 이용하여 똑같이 A 배열을 구성하고 fft를 돌려서 시간복잡도를 맞추어 주면 문제를 해결 할 수 있다. 아래의 코드는 이 풀이 기반 코드이다. &lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;코드&lt;/b&gt;&lt;/h3&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #f0f0f0; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #272727; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #4f4f4f;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #aaa; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;25&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;26&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;27&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;28&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;29&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;30&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;31&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;32&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;33&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;34&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;35&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;36&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;37&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;38&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;39&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;40&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;41&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;42&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;43&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;44&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;45&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;46&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;47&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;48&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;49&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;50&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;51&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;52&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;53&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;54&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;55&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;56&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;57&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;58&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;59&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;60&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;61&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;62&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;63&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;64&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;65&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;66&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;67&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;68&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;69&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;70&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;71&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;72&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;73&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;74&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;75&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;76&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;77&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;78&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;79&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;80&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;81&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;82&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;83&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;84&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;85&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;86&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;87&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;88&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;89&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;90&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;91&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;92&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;93&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;94&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;95&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;96&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;97&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;98&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;99&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;100&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;101&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;102&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;103&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;104&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;105&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;106&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;107&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;108&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;109&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;110&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;111&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;112&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;113&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;114&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;115&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;116&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;117&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;118&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;119&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;120&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;121&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;122&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;123&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;124&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;125&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;126&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;127&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;128&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;129&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;130&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;131&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;132&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;133&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;134&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;135&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;136&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;137&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;138&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;139&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;140&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;141&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;142&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;143&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;144&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #f0f0f0; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#include&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;bits&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;/&lt;/span&gt;stdc&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;.h&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;using&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;namespace&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;std&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;typedef&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;long&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;long&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;int&lt;/span&gt;&amp;nbsp;ll;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;typedef&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;double&lt;/span&gt;&amp;nbsp;dl;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;typedef&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;pair&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;dl,dl&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;pdi;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;typedef&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;pair&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;ll,ll&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;pii;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;typedef&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;pair&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;ll,pii&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;piii;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;ff&amp;nbsp;first&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;ss&amp;nbsp;second&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;eb&amp;nbsp;emplace_back&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;ep&amp;nbsp;emplace&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;pb&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;push_back&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;mp&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;make_pair&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;all(x)&amp;nbsp;(x).&lt;span style=&quot;color: #4be6fa;&quot;&gt;begin&lt;/span&gt;(),&amp;nbsp;(x).&lt;span style=&quot;color: #4be6fa;&quot;&gt;end&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;compress(v)&amp;nbsp;sort(all(v)),&amp;nbsp;v.erase(unique(all(v)),&amp;nbsp;v.&lt;span style=&quot;color: #4be6fa;&quot;&gt;end&lt;/span&gt;())&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;IDX(v,&amp;nbsp;x)&amp;nbsp;lower_bound(all(v),&amp;nbsp;x)&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;-&lt;/span&gt;&amp;nbsp;v.&lt;span style=&quot;color: #4be6fa;&quot;&gt;begin&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;//cout&amp;lt;&amp;lt;fixed;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;//cout.precision(12);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;struct&lt;/span&gt;&amp;nbsp;poi{&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ll&amp;nbsp;val,xx,yy;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;};&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;namespace&lt;/span&gt;&amp;nbsp;fft{&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;using&lt;/span&gt;&amp;nbsp;real_t&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;double&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;using&lt;/span&gt;&amp;nbsp;cpx&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&amp;nbsp;complex&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;real_t&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;void&lt;/span&gt;&amp;nbsp;FFT(&lt;span style=&quot;color: #4be6fa;&quot;&gt;vector&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;cpx&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;amp;&lt;/span&gt;a,&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;bool&lt;/span&gt;&amp;nbsp;inv_fft&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;false&lt;/span&gt;){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;int&lt;/span&gt;&amp;nbsp;N&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&amp;nbsp;a.&lt;span style=&quot;color: #4be6fa;&quot;&gt;size&lt;/span&gt;();&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;vector&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;cpx&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;root(N&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;2&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #4be6fa;&quot;&gt;int&lt;/span&gt;&amp;nbsp;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;,&amp;nbsp;j&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;;&amp;nbsp;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;N;&amp;nbsp;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;int&lt;/span&gt;&amp;nbsp;bit&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&amp;nbsp;(N&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;while&lt;/span&gt;(j&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&amp;nbsp;bit)&amp;nbsp;j&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&amp;nbsp;bit,&amp;nbsp;bit&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;j&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&amp;nbsp;bit;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;if&lt;/span&gt;(i&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;j)&amp;nbsp;swap(a[i],&amp;nbsp;a[j]);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;real_t&amp;nbsp;ang&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #c10aff;&quot;&gt;2&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;*&lt;/span&gt;&amp;nbsp;acos(&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;)&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;/&lt;/span&gt;&amp;nbsp;N&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;*&lt;/span&gt;&amp;nbsp;(inv_fft&amp;nbsp;?&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;&amp;nbsp;:&amp;nbsp;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #4be6fa;&quot;&gt;int&lt;/span&gt;&amp;nbsp;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;;&amp;nbsp;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;N&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;2&lt;/span&gt;;&amp;nbsp;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;)&amp;nbsp;root[i]&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&amp;nbsp;cpx(cos(ang&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;*&lt;/span&gt;&amp;nbsp;i),&amp;nbsp;sin(ang&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;*&lt;/span&gt;&amp;nbsp;i));&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #4be6fa;&quot;&gt;int&lt;/span&gt;&amp;nbsp;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;2&lt;/span&gt;;&amp;nbsp;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;N;&amp;nbsp;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;int&lt;/span&gt;&amp;nbsp;step&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&amp;nbsp;N&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;/&lt;/span&gt;&amp;nbsp;i;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #4be6fa;&quot;&gt;int&lt;/span&gt;&amp;nbsp;j&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;;&amp;nbsp;j&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;N;&amp;nbsp;j&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;i){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #4be6fa;&quot;&gt;int&lt;/span&gt;&amp;nbsp;k&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;;&amp;nbsp;k&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;2&lt;/span&gt;;&amp;nbsp;k&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;cpx&amp;nbsp;u&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&amp;nbsp;a[j&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;k],&amp;nbsp;v&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&amp;nbsp;a[j&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;k&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;2&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;*&lt;/span&gt;&amp;nbsp;root[step&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;*&lt;/span&gt;&amp;nbsp;k];&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;a[j&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;k]&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&amp;nbsp;u&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;v;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;a[j&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;k&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;2&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&amp;nbsp;u&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;-&lt;/span&gt;v;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;if&lt;/span&gt;(inv_fft)&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #4be6fa;&quot;&gt;int&lt;/span&gt;&amp;nbsp;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;;&amp;nbsp;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;N;&amp;nbsp;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;)&amp;nbsp;a[i]&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&amp;nbsp;N;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;vector&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;ll&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;multiply_mod(&lt;span style=&quot;color: #ff3399;&quot;&gt;const&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;vector&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #4be6fa;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;amp;&lt;/span&gt;a,&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;const&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;vector&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #4be6fa;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;amp;&lt;/span&gt;b,&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;const&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;int&lt;/span&gt;&amp;nbsp;mod){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;int&lt;/span&gt;&amp;nbsp;N&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #c10aff;&quot;&gt;2&lt;/span&gt;;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;while&lt;/span&gt;(N&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;a.&lt;span style=&quot;color: #4be6fa;&quot;&gt;size&lt;/span&gt;()&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&amp;nbsp;b.&lt;span style=&quot;color: #4be6fa;&quot;&gt;size&lt;/span&gt;())&amp;nbsp;N&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;vector&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;cpx&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;v1(N),&amp;nbsp;v2(N),&amp;nbsp;r1(N),&amp;nbsp;r2(N);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #4be6fa;&quot;&gt;int&lt;/span&gt;&amp;nbsp;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;;&amp;nbsp;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;a.&lt;span style=&quot;color: #4be6fa;&quot;&gt;size&lt;/span&gt;();&amp;nbsp;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;)&amp;nbsp;v1[i]&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&amp;nbsp;cpx(a[i]&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #c10aff;&quot;&gt;15&lt;/span&gt;,&amp;nbsp;a[i]&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;amp;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #c10aff;&quot;&gt;32767&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #4be6fa;&quot;&gt;int&lt;/span&gt;&amp;nbsp;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;;&amp;nbsp;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;b.&lt;span style=&quot;color: #4be6fa;&quot;&gt;size&lt;/span&gt;();&amp;nbsp;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;)&amp;nbsp;v2[i]&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&amp;nbsp;cpx(b[i]&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #c10aff;&quot;&gt;15&lt;/span&gt;,&amp;nbsp;b[i]&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;amp;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #c10aff;&quot;&gt;32767&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;FFT(v1);&amp;nbsp;FFT(v2);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #4be6fa;&quot;&gt;int&lt;/span&gt;&amp;nbsp;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;;&amp;nbsp;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;N;&amp;nbsp;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;int&lt;/span&gt;&amp;nbsp;j&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&amp;nbsp;i&amp;nbsp;?&amp;nbsp;N&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;-&lt;/span&gt;i&amp;nbsp;:&amp;nbsp;i;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;cpx&amp;nbsp;ans1&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&amp;nbsp;(v1[i]&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&amp;nbsp;conj(v1[j]))&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;*&lt;/span&gt;&amp;nbsp;cpx(&lt;span style=&quot;color: #c10aff;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;5&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;cpx&amp;nbsp;ans2&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&amp;nbsp;(v1[i]&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;-&lt;/span&gt;&amp;nbsp;conj(v1[j]))&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;*&lt;/span&gt;&amp;nbsp;cpx(&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;5&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;cpx&amp;nbsp;ans3&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&amp;nbsp;(v2[i]&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&amp;nbsp;conj(v2[j]))&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;*&lt;/span&gt;&amp;nbsp;cpx(&lt;span style=&quot;color: #c10aff;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;5&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;cpx&amp;nbsp;ans4&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&amp;nbsp;(v2[i]&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;-&lt;/span&gt;&amp;nbsp;conj(v2[j]))&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;*&lt;/span&gt;&amp;nbsp;cpx(&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;5&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;r1[i]&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&amp;nbsp;(ans1&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;*&lt;/span&gt;&amp;nbsp;ans3)&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&amp;nbsp;(ans1&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;*&lt;/span&gt;&amp;nbsp;ans4)&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;*&lt;/span&gt;&amp;nbsp;cpx(&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;r2[i]&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&amp;nbsp;(ans2&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;*&lt;/span&gt;&amp;nbsp;ans3)&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&amp;nbsp;(ans2&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;*&lt;/span&gt;&amp;nbsp;ans4)&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;*&lt;/span&gt;&amp;nbsp;cpx(&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;FFT(r1,&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;true&lt;/span&gt;);&amp;nbsp;FFT(r2,&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;true&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;vector&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;ll&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;ret(N);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #4be6fa;&quot;&gt;int&lt;/span&gt;&amp;nbsp;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;;&amp;nbsp;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;N;&amp;nbsp;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ll&amp;nbsp;av&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&amp;nbsp;llround(r1[i].real());&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ll&amp;nbsp;bv&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&amp;nbsp;llround(r1[i].imag())&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&amp;nbsp;llround(r2[i].real());&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ll&amp;nbsp;cv&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&amp;nbsp;llround(r2[i].imag());&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;av&amp;nbsp;%&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&amp;nbsp;mod,&amp;nbsp;bv&amp;nbsp;%&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&amp;nbsp;mod,&amp;nbsp;cv&amp;nbsp;%&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&amp;nbsp;mod;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ret[i]&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&amp;nbsp;(av&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #c10aff;&quot;&gt;30&lt;/span&gt;)&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&amp;nbsp;(bv&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #c10aff;&quot;&gt;15&lt;/span&gt;)&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&amp;nbsp;cv;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ret[i]&amp;nbsp;%&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&amp;nbsp;mod;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ret[i]&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&amp;nbsp;mod;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ret[i]&amp;nbsp;%&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&amp;nbsp;mod;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;return&lt;/span&gt;&amp;nbsp;ret;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #4be6fa;&quot;&gt;vector&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #4be6fa;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;x;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;ll&amp;nbsp;n,m;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;ll&amp;nbsp;mod&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;998244353&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #4be6fa;&quot;&gt;string&lt;/span&gt;&amp;nbsp;s;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #4be6fa;&quot;&gt;string&lt;/span&gt;&amp;nbsp;t;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;ll&amp;nbsp;arr[&lt;span style=&quot;color: #c10aff;&quot;&gt;1010101&lt;/span&gt;];&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;ll&amp;nbsp;brr[&lt;span style=&quot;color: #c10aff;&quot;&gt;1010101&lt;/span&gt;];&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #4be6fa;&quot;&gt;vector&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;ll&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;v[&lt;span style=&quot;color: #c10aff;&quot;&gt;1010101&lt;/span&gt;];&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #4be6fa;&quot;&gt;vector&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #4be6fa;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;an;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #4be6fa;&quot;&gt;vector&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;ll&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;res;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;mt19937&amp;nbsp;rd((&lt;span style=&quot;color: #ff3399;&quot;&gt;unsigned&lt;/span&gt;)chrono::steady_clock::now().time_since_epoch().count());&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #4be6fa;&quot;&gt;int&lt;/span&gt;&amp;nbsp;grnd(ll&amp;nbsp;a,ll&amp;nbsp;b){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;uniform_int_distribution&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #4be6fa;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;rnd(a,&amp;nbsp;b);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;return&lt;/span&gt;&amp;nbsp;rnd(rd);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;ll&amp;nbsp;ans[&lt;span style=&quot;color: #c10aff;&quot;&gt;1010101&lt;/span&gt;];&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #4be6fa;&quot;&gt;int&lt;/span&gt;&amp;nbsp;main(){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ios_base::sync_with_stdio(&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;cin&lt;/span&gt;.tie(&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ll&amp;nbsp;i,j,k,a,b,c,d,e,f;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;cin&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;n&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;m&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;k;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;for&lt;/span&gt;(i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;n;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ll&amp;nbsp;idx&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;n&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;-&lt;/span&gt;i;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;cin&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;a;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arr[idx]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;n&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;-&lt;/span&gt;a;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;for&lt;/span&gt;(i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;m;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;cin&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;a;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;an.pb(a);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;for&lt;/span&gt;(i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;m&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;n;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ans[i]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;for&lt;/span&gt;(ll&amp;nbsp;p&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;;p&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;3&lt;/span&gt;;p&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;x.clear();&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;x.resize(n);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;for&lt;/span&gt;(i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;7&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;*&lt;/span&gt;n;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ll&amp;nbsp;f&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;grnd(&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;,n&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ll&amp;nbsp;val&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;grnd(&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;,p&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;100&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;x[min(f,arr[f])]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;val;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;x[max(f,arr[f])]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;val;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;res&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;fft::multiply_mod(x,&amp;nbsp;an,&amp;nbsp;&lt;span style=&quot;color: #c10aff;&quot;&gt;998244353&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;for&lt;/span&gt;(i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;n&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;m;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;if&lt;/span&gt;(res[i])&amp;nbsp;ans[i]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;for&lt;/span&gt;(i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;n&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;m;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;cout&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;ans[i];&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: right; margin-top: -13px; margin-right: 5px; font-size: 9px; font-style: italic;&quot;&gt;&lt;a style=&quot;color: #4f4f4ftext-decoration:none;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #4f4f4f; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;</description>
      <category>코딩/백준 문제 풀이</category>
      <category>BOJ</category>
      <author>stonejjun</author>
      <guid isPermaLink="true">https://stonejjun.tistory.com/213</guid>
      <comments>https://stonejjun.tistory.com/213#entry213comment</comments>
      <pubDate>Sat, 27 Aug 2022 04:39:30 +0900</pubDate>
    </item>
    <item>
      <title>BOJ 8103 - Rooks</title>
      <link>https://stonejjun.tistory.com/212</link>
      <description>&lt;p data-ke-size=&quot;size16&quot;&gt;문제 링크 : &lt;a href=&quot;https://www.acmicpc.net/problem/8103&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://www.acmicpc.net/problem/8103&lt;/a&gt;&lt;/p&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;문제 풀이&lt;/b&gt;&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;가능한 위치가 직사각형으로 주어진다. 직사각형이기 때문에&amp;nbsp; y 좌표가 가능한 범위는 x 좌표에 영향을 받지 않는다. 따라서 x와 y를 따로 놓고 생각해서 구할 수 있다. 주어진 문제를 축 별로 쪼개서 본다고 하면, 구간이 n개 주어지고 n개의 구간에서 각각 수를 하나 씩 뽑아야 하는데 이 수가 1~n까지 서로 다른 수여야 한다.&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;위의 문제를 어떻게 풀 수 있을까? 이미 1~i-1 까지 배정을 했다고 하자. 이제 i를 어떤 구간에다가 배정해야 할 지 골라야 한다. 가능한 구간은 s~e에서 s가 i보다 작으며, e가 i보다 큰 구간들이다. 이러한 구간들에서 e가 가장 작은 구간을 뽑는 것이 이득이다. 앞으로 가능한 구간은 i~e 이기 때문에 e가 더 큰 구간은 가능한 경우가 e가 더 작은 구간을 포함하게 된다. 따라서 항상 가능한 구간들 중 그리디하게 e가 가장 작은 구간을 배정하는 것이 옳다.&amp;nbsp;&lt;br /&gt;&amp;nbsp;구간을 빼고 넣으면서 가능한 구간을 e가 작은 순서대로 들고 있는 것은 pq를 쓰면 할 수 있다. 따라서 전체 문제를 $O(NlgN)$ 에 해결할 수 있으며, 문제에서 제공한 제한 3000은 굉장히 이에 비해서 작은 값이다.&amp;nbsp;&lt;/p&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;코드&lt;/b&gt;&lt;/h3&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #f0f0f0; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #272727; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #4f4f4f;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #aaa; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;25&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;26&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;27&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;28&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;29&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;30&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;31&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;32&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;33&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;34&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;35&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;36&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;37&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;38&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;39&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;40&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;41&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;42&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;43&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;44&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;45&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;46&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;47&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;48&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;49&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;50&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;51&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;52&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;53&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;54&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;55&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;56&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;57&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;58&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;59&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;60&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;61&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;62&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;63&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;64&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;65&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;66&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;67&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;68&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;69&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;70&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;71&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;72&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;73&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;74&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;75&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;76&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;77&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;78&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;79&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;80&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;81&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;82&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;83&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;84&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;85&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;86&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;87&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;88&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;89&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;90&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;91&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;92&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;93&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;94&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;95&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;96&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;97&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;98&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;99&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;100&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;101&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;102&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;103&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;104&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;105&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #f0f0f0; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#include&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;bits&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;/&lt;/span&gt;stdc&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;.h&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;using&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;namespace&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;std&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;typedef&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;long&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;long&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;int&lt;/span&gt;&amp;nbsp;ll;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;typedef&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;double&lt;/span&gt;&amp;nbsp;dl;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;typedef&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;pair&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;dl,dl&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;pdi;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;typedef&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;pair&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;ll,ll&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;pii;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;typedef&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;pair&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;ll,pii&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;piii;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;ff&amp;nbsp;first&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;ss&amp;nbsp;second&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;eb&amp;nbsp;emplace_back&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;ep&amp;nbsp;emplace&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;pb&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;push_back&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;mp&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;make_pair&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;all(x)&amp;nbsp;(x).&lt;span style=&quot;color: #4be6fa;&quot;&gt;begin&lt;/span&gt;(),&amp;nbsp;(x).&lt;span style=&quot;color: #4be6fa;&quot;&gt;end&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;compress(v)&amp;nbsp;sort(all(v)),&amp;nbsp;v.erase(unique(all(v)),&amp;nbsp;v.&lt;span style=&quot;color: #4be6fa;&quot;&gt;end&lt;/span&gt;())&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;IDX(v,&amp;nbsp;x)&amp;nbsp;lower_bound(all(v),&amp;nbsp;x)&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;-&lt;/span&gt;&amp;nbsp;v.&lt;span style=&quot;color: #4be6fa;&quot;&gt;begin&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;//cout&amp;lt;&amp;lt;fixed;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;//cout.precision(12);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;struct&lt;/span&gt;&amp;nbsp;poi{&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ll&amp;nbsp;idx,s,e;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;};&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;struct&lt;/span&gt;&amp;nbsp;sf1{&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;bool&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;operator&lt;/span&gt;()(poi&amp;nbsp;a,poi&amp;nbsp;b){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;return&lt;/span&gt;&amp;nbsp;a.e&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;b.e;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;};&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #4be6fa;&quot;&gt;bool&lt;/span&gt;&amp;nbsp;sf(poi&amp;nbsp;a,poi&amp;nbsp;b){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;return&lt;/span&gt;&amp;nbsp;a.s&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;b.s;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #4be6fa;&quot;&gt;vector&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;ll&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;x;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;ll&amp;nbsp;n,m;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;ll&amp;nbsp;mod&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;998244353&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #4be6fa;&quot;&gt;string&lt;/span&gt;&amp;nbsp;s;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #4be6fa;&quot;&gt;string&lt;/span&gt;&amp;nbsp;t;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;poi&amp;nbsp;ax[&lt;span style=&quot;color: #c10aff;&quot;&gt;1010101&lt;/span&gt;];&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;poi&amp;nbsp;bx[&lt;span style=&quot;color: #c10aff;&quot;&gt;1010101&lt;/span&gt;];&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;ll&amp;nbsp;ansa[&lt;span style=&quot;color: #c10aff;&quot;&gt;1010101&lt;/span&gt;];&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;ll&amp;nbsp;ansb[&lt;span style=&quot;color: #c10aff;&quot;&gt;1010101&lt;/span&gt;];&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #4be6fa;&quot;&gt;vector&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;ll&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;v[&lt;span style=&quot;color: #c10aff;&quot;&gt;1010101&lt;/span&gt;];&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;priority_queue&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;poi,&lt;span style=&quot;color: #4be6fa;&quot;&gt;vector&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;poi&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;,sf1&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;pqa;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;priority_queue&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;poi,&lt;span style=&quot;color: #4be6fa;&quot;&gt;vector&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;poi&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;,sf1&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;pqb;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #4be6fa;&quot;&gt;int&lt;/span&gt;&amp;nbsp;main(){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ios_base::sync_with_stdio(&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;cin&lt;/span&gt;.tie(&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ll&amp;nbsp;i,j,k,a,b,c,d,e,f;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;cin&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;n;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;for&lt;/span&gt;(i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;n;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;cin&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;ax[i].s;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;cin&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;bx[i].s;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;cin&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;ax[i].e;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;cin&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;bx[i].e;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ax[i].idx&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;bx[i].idx&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;i;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sort(ax&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;,ax&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;n,sf);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sort(bx&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;,bx&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;n,sf);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ll&amp;nbsp;fla&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ll&amp;nbsp;flb&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;for&lt;/span&gt;(i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;n;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;while&lt;/span&gt;(ax[fla].s&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;i){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pqa.push(ax[fla]);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fla&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;if&lt;/span&gt;(pqa.empty()){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;cout&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #ffd500;&quot;&gt;&quot;NIE&quot;&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;return&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;auto&lt;/span&gt;&amp;nbsp;x&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;pqa.top();&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;//cout&amp;lt;&amp;lt;i&amp;lt;&amp;lt;'&amp;nbsp;'&amp;lt;&amp;lt;x.idx&amp;lt;&amp;lt;'\n';&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;if&lt;/span&gt;(x.e&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;i){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;cout&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #ffd500;&quot;&gt;&quot;NIE&quot;&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;return&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pqa.&lt;span style=&quot;color: #4be6fa;&quot;&gt;pop&lt;/span&gt;();&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ansa[x.idx]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;i;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;while&lt;/span&gt;(bx[flb].s&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;i){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pqb.push(bx[flb]);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;flb&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;if&lt;/span&gt;(pqb.empty()){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;cout&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #ffd500;&quot;&gt;&quot;NIE&quot;&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;return&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;x&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;pqb.top();&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;if&lt;/span&gt;(x.e&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;i){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;cout&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #ffd500;&quot;&gt;&quot;NIE&quot;&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;return&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pqb.&lt;span style=&quot;color: #4be6fa;&quot;&gt;pop&lt;/span&gt;();&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ansb[x.idx]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;i;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;//cout&amp;lt;&amp;lt;i&amp;lt;&amp;lt;'&amp;nbsp;'&amp;lt;&amp;lt;x.idx&amp;lt;&amp;lt;'\n';&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;for&lt;/span&gt;(i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;n;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;cout&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;ansa[i]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #ffd500;&quot;&gt;'&amp;nbsp;'&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;ansb[i]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #ffd500;&quot;&gt;'\n'&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: right; margin-top: -13px; margin-right: 5px; font-size: 9px; font-style: italic;&quot;&gt;&lt;a style=&quot;color: #4f4f4ftext-decoration:none;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #4f4f4f; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;</description>
      <category>코딩/백준 문제 풀이</category>
      <category>BOJ</category>
      <author>stonejjun</author>
      <guid isPermaLink="true">https://stonejjun.tistory.com/212</guid>
      <comments>https://stonejjun.tistory.com/212#entry212comment</comments>
      <pubDate>Sat, 27 Aug 2022 03:20:57 +0900</pubDate>
    </item>
    <item>
      <title>BOJ 10169 - 안전한 비상연락망</title>
      <link>https://stonejjun.tistory.com/211</link>
      <description>&lt;p data-ke-size=&quot;size16&quot;&gt;문제 링크 : &lt;a href=&quot;https://www.acmicpc.net/problem/10169&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://www.acmicpc.net/problem/10169&lt;/a&gt;&lt;/p&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;문제 풀이&lt;/b&gt;&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;부분 부분 알고 있었던 내용이었다. 간선이 하나씩 없어지는데 각각의 경우에 MST 길이 합을 구하는 문제이다.&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;가장 먼저 생각할 수 있는 부분은 맨 처음에 전체 그래프에서 MST를 구해서 MST에 쓰이는 간선과 쓰이지 않는 간선을 나눌 수 있다는 것이다. 또한 거기에 더해서 첫 MST 에 쓰이지 않는 간선들은 제외를 해도 길이 합이 변하지 않는 다는 것 까지 알 수 있다. 그렇다면 첫 MST에 쓰인 간선이 지워졌을 때 대체하는 최소 비용의 간선을 모든 간선에 대해서 다 구해야 한다.&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;그 이후로는 &lt;a href=&quot;https://codeforces.com/contest/1707/problem/C&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;이 문제의&lt;/a&gt; 경험이 굉장히 도움이 되었다. MST에 속하지 않은 간선 들은 cross edge 또는 back edge가 된다. 이때 MST에 속한 간선 E의 양 끝 노드 중 더 아래쪽 노드 p에 대해서 간선의 한 쪽 끝이 p의 서브 트리에 속해 있고, 나머지 하나는 그렇지 않은 back edge나 cross edge 들은 그 간선 E의 대체 간선이 될 수 있다. 이는 E가 사라지게 되면 전체 트리가 p의 서브 트리와 그렇지 않은 부분의 두 부분으로 쪼개지기 때문이다.&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;이를 반대로 생각해보자. MST 에 속하지 않은 간선 E는 E의 양 끝 두 노드 사이의 경로에서 LCA를 뺀 부분에 대하여 대체 간선이 될 수 있다. 그렇게 대체할 수 있다고 체크를 해두면, 나중에 트리의 각 위치에 대해서 대체 가능한 값 중 최솟값을 선택하면 되고, 이 모든 것이 트리의 경로에서 업뎃이 이루어지기 때문에 HLD+lazy segment tree 를 쓰면 된다는 결론이 나온다.&amp;nbsp;&lt;/p&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;코드&lt;/b&gt;&lt;/h3&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #f0f0f0; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #272727; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #4f4f4f;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #aaa; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;25&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;26&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;27&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;28&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;29&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;30&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;31&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;32&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;33&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;34&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;35&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;36&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;37&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;38&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;39&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;40&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;41&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;42&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;43&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;44&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;45&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;46&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;47&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;48&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;49&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;50&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;51&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;52&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;53&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;54&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;55&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;56&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;57&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;58&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;59&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;60&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;61&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;62&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;63&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;64&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;65&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;66&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;67&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;68&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;69&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;70&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;71&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;72&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;73&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;74&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;75&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;76&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;77&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;78&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;79&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;80&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;81&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;82&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;83&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;84&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;85&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;86&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;87&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;88&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;89&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;90&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;91&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;92&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;93&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;94&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;95&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;96&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;97&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;98&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;99&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;100&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;101&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;102&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;103&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;104&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;105&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;106&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;107&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;108&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;109&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;110&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;111&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;112&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;113&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;114&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;115&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;116&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;117&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;118&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;119&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;120&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;121&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;122&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;123&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;124&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;125&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;126&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;127&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;128&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;129&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;130&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;131&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;132&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;133&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;134&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;135&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;136&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;137&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;138&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;139&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;140&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;141&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;142&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;143&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;144&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;145&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;146&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;147&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;148&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;149&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;150&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;151&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;152&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;153&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;154&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;155&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;156&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;157&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;158&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;159&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;160&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;161&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;162&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;163&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;164&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;165&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;166&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;167&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;168&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;169&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;170&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;171&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;172&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;173&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;174&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;175&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;176&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;177&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;178&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;179&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;180&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;181&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;182&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;183&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;184&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;185&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;186&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;187&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;188&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;189&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;190&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;191&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;192&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;193&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;194&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;195&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;196&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;197&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;198&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;199&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;200&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;201&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;202&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;203&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;204&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;205&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;206&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;207&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;208&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #f0f0f0; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#include&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;bits&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;/&lt;/span&gt;stdc&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;.h&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;using&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;namespace&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;std&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;typedef&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;int&lt;/span&gt;&amp;nbsp;ll;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;typedef&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;double&lt;/span&gt;&amp;nbsp;dl;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;typedef&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;pair&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;dl,dl&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;pdi;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;typedef&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;pair&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;ll,ll&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;pii;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;typedef&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;pair&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;ll,pii&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;piii;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;ff&amp;nbsp;first&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;ss&amp;nbsp;second&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;eb&amp;nbsp;emplace_back&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;ep&amp;nbsp;emplace&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;pb&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;push_back&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;mp&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;make_pair&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;all(x)&amp;nbsp;(x).&lt;span style=&quot;color: #4be6fa;&quot;&gt;begin&lt;/span&gt;(),&amp;nbsp;(x).&lt;span style=&quot;color: #4be6fa;&quot;&gt;end&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;compress(v)&amp;nbsp;sort(all(v)),&amp;nbsp;v.erase(unique(all(v)),&amp;nbsp;v.&lt;span style=&quot;color: #4be6fa;&quot;&gt;end&lt;/span&gt;())&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;IDX(v,&amp;nbsp;x)&amp;nbsp;lower_bound(all(v),&amp;nbsp;x)&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;-&lt;/span&gt;&amp;nbsp;v.&lt;span style=&quot;color: #4be6fa;&quot;&gt;begin&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;//cout&amp;lt;&amp;lt;fixed;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;//cout.precision(12);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;struct&lt;/span&gt;&amp;nbsp;poi{&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ll&amp;nbsp;c,a,b,idx,chk;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;};&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #4be6fa;&quot;&gt;vector&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;ll&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;x;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;ll&amp;nbsp;n,m;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;ll&amp;nbsp;mod&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;998244353&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #4be6fa;&quot;&gt;string&lt;/span&gt;&amp;nbsp;s;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #4be6fa;&quot;&gt;string&lt;/span&gt;&amp;nbsp;t;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;ll&amp;nbsp;arr[&lt;span style=&quot;color: #c10aff;&quot;&gt;310101&lt;/span&gt;];&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #4be6fa;&quot;&gt;vector&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;ll&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;v[&lt;span style=&quot;color: #c10aff;&quot;&gt;310101&lt;/span&gt;];&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #4be6fa;&quot;&gt;vector&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;poi&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;nov;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;ll&amp;nbsp;par[&lt;span style=&quot;color: #c10aff;&quot;&gt;310101&lt;/span&gt;];&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #4be6fa;&quot;&gt;vector&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;poi&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;edg;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;ll&amp;nbsp;in[&lt;span style=&quot;color: #c10aff;&quot;&gt;310101&lt;/span&gt;];&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;ll&amp;nbsp;out[&lt;span style=&quot;color: #c10aff;&quot;&gt;310101&lt;/span&gt;];&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;pii&amp;nbsp;tree[&lt;span style=&quot;color: #c10aff;&quot;&gt;1010101&lt;/span&gt;];&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #4be6fa;&quot;&gt;long&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;long&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;int&lt;/span&gt;&amp;nbsp;ans[&lt;span style=&quot;color: #c10aff;&quot;&gt;310101&lt;/span&gt;];&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;ll&amp;nbsp;dep[&lt;span style=&quot;color: #c10aff;&quot;&gt;310101&lt;/span&gt;];&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;ll&amp;nbsp;sz[&lt;span style=&quot;color: #c10aff;&quot;&gt;310101&lt;/span&gt;];&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;ll&amp;nbsp;top[&lt;span style=&quot;color: #c10aff;&quot;&gt;310101&lt;/span&gt;];&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #4be6fa;&quot;&gt;vector&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;ll&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;dv[&lt;span style=&quot;color: #c10aff;&quot;&gt;310101&lt;/span&gt;];&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;void&lt;/span&gt;&amp;nbsp;dfs1(ll&amp;nbsp;x){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sz[x]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #ff3399;&quot;&gt;auto&lt;/span&gt;&amp;nbsp;n:v[x]){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;if&lt;/span&gt;(sz[n])&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;continue&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dep[n]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;dep[x]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;par[n]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;x;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dfs1(n);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sz[x]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;sz[n];&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dv[x].&lt;span style=&quot;color: #4be6fa;&quot;&gt;push_back&lt;/span&gt;(n);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;if&lt;/span&gt;(sz[n]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;sz[dv[x][&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;]])&amp;nbsp;swap(dv[x][&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;],dv[x].back());&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;ll&amp;nbsp;np;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;void&lt;/span&gt;&amp;nbsp;dfs2(ll&amp;nbsp;x){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;np&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;in[x]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;np;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #ff3399;&quot;&gt;auto&lt;/span&gt;&amp;nbsp;k:dv[x]){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;if&lt;/span&gt;(dv[x][&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;k)&amp;nbsp;top[k]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;top[x];&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;else&lt;/span&gt;&amp;nbsp;top[k]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;k;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dfs2(k);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;out[x]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;np;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;ll&amp;nbsp;fi(ll&amp;nbsp;x){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;if&lt;/span&gt;(x&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;par[x])&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;return&lt;/span&gt;&amp;nbsp;x;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;return&lt;/span&gt;&amp;nbsp;par[x]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;fi(par[x]);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;void&lt;/span&gt;&amp;nbsp;mer(ll&amp;nbsp;a,ll&amp;nbsp;b){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;a&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;fi(a);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;b&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;fi(b);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;par[a]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;b;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #4be6fa;&quot;&gt;bool&lt;/span&gt;&amp;nbsp;sf(poi&amp;nbsp;a,poi&amp;nbsp;b){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;return&lt;/span&gt;&amp;nbsp;a.c&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;b.c;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;void&lt;/span&gt;&amp;nbsp;laz(ll&amp;nbsp;s,ll&amp;nbsp;e,ll&amp;nbsp;nod){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;if&lt;/span&gt;(tree[nod].ss&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1e9&lt;/span&gt;){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;if&lt;/span&gt;(s&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;e){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tree[nod&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;2&lt;/span&gt;].ss&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;min(tree[nod].ss,tree[nod&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;2&lt;/span&gt;].ss);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tree[nod&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;].ss&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;min(tree[nod].ss,tree[nod&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;].ss);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tree[nod].ff&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;min(tree[nod].ff,tree[nod].ss);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tree[nod].ss&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1e9&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;void&lt;/span&gt;&amp;nbsp;upt(ll&amp;nbsp;l,ll&amp;nbsp;r,ll&amp;nbsp;v,ll&amp;nbsp;s,ll&amp;nbsp;e,ll&amp;nbsp;nod){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;if&lt;/span&gt;(r&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;s&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;|&lt;/span&gt;e&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;l)&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;return&lt;/span&gt;&amp;nbsp;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;if&lt;/span&gt;(l&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;s&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;amp;&lt;/span&gt;e&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;r){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tree[nod].ss&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;min(tree[nod].ss,v);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;return&lt;/span&gt;&amp;nbsp;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ll&amp;nbsp;m&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;(s&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;e)&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;2&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;upt(l,r,v,s,m,nod&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;2&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;upt(l,r,v,m&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;,e,nod&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;return&lt;/span&gt;&amp;nbsp;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;ll&amp;nbsp;solval;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;void&lt;/span&gt;&amp;nbsp;sol(ll&amp;nbsp;idx,ll&amp;nbsp;s,ll&amp;nbsp;e,ll&amp;nbsp;nod){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;laz(s,e,nod);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;if&lt;/span&gt;(idx&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;s&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;|&lt;/span&gt;idx&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;e)&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;return&lt;/span&gt;&amp;nbsp;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;if&lt;/span&gt;(s&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;e){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;solval&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;tree[nod].ff;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;else&lt;/span&gt;{&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sol(idx,s,(s&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;e)&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;2&lt;/span&gt;,nod&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;2&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sol(idx,(s&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;e)&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;,e,nod&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;return&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;void&lt;/span&gt;&amp;nbsp;lupt(ll&amp;nbsp;a,ll&amp;nbsp;b,ll&amp;nbsp;v){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;while&lt;/span&gt;(top[a]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;top[b]){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;if&lt;/span&gt;(dep[top[a]]&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;dep[top[b]])&amp;nbsp;swap(a,&amp;nbsp;b);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ll&amp;nbsp;x&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;top[b];&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;upt(in[x],in[b],v,&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;,n,&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;b&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;par[x];&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;if&lt;/span&gt;(dep[a]&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;dep[b])&amp;nbsp;swap(a,&amp;nbsp;b);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;upt(in[a]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;,in[b],v,&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;,n,&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #4be6fa;&quot;&gt;int&lt;/span&gt;&amp;nbsp;main(){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ios_base::sync_with_stdio(&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;cin&lt;/span&gt;.tie(&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ll&amp;nbsp;i,j,k,a,b,c,d,e,f;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;cin&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;n&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;m;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;for&lt;/span&gt;(i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;n;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;par[i]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;i;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;for&lt;/span&gt;(i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;m;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;poi&amp;nbsp;x;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;cin&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;x.a&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;x.b&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;x.c;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;x.idx&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;i;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;x.chk&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;edg.pb(x);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sort(edg.&lt;span style=&quot;color: #4be6fa;&quot;&gt;begin&lt;/span&gt;(),&amp;nbsp;edg.&lt;span style=&quot;color: #4be6fa;&quot;&gt;end&lt;/span&gt;(),sf);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;long&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;long&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;int&lt;/span&gt;&amp;nbsp;val&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #ff3399;&quot;&gt;auto&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;amp;&lt;/span&gt;k:edg){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;if&lt;/span&gt;(fi(k.a)&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;fi(k.b)){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;v[k.a].pb(k.b);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;v[k.b].pb(k.a);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;k.chk&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mer(k.a,k.b);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;val&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;k.c;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;else&lt;/span&gt;{&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;nov.pb(k);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;for&lt;/span&gt;(i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;n;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;par[i]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dep[&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dfs1(&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;top[&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dfs2(&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;for&lt;/span&gt;(i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1010100&lt;/span&gt;;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tree[i].ff&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1e9&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tree[i].ss&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1e9&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #ff3399;&quot;&gt;auto&lt;/span&gt;&amp;nbsp;k:nov){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;lupt(k.a,k.b,k.c);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #ff3399;&quot;&gt;auto&lt;/span&gt;&amp;nbsp;k:edg){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;if&lt;/span&gt;(&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;!&lt;/span&gt;k.chk){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ans[k.idx]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;val;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;else&lt;/span&gt;{&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ll&amp;nbsp;x;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;if&lt;/span&gt;(dep[k.a]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;dep[k.b])&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;x&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;k.a;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;else&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;x&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;k.b;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sol(in[x],&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;,n,&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;if&lt;/span&gt;(solval&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1e9&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ans[k.idx]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;else&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ans[k.idx]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;val&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;-&lt;/span&gt;k.c&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;solval;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;for&lt;/span&gt;(i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;m;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;cout&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;ans[i]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #ffd500;&quot;&gt;'\n'&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;}&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: right; margin-top: -13px; margin-right: 5px; font-size: 9px; font-style: italic;&quot;&gt;&lt;a style=&quot;color: #4f4f4ftext-decoration:none;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #4f4f4f; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;</description>
      <category>코딩/백준 문제 풀이</category>
      <category>BOJ</category>
      <author>stonejjun</author>
      <guid isPermaLink="true">https://stonejjun.tistory.com/211</guid>
      <comments>https://stonejjun.tistory.com/211#entry211comment</comments>
      <pubDate>Fri, 26 Aug 2022 17:08:02 +0900</pubDate>
    </item>
    <item>
      <title>BOJ 3682 - 동치 증명</title>
      <link>https://stonejjun.tistory.com/210</link>
      <description>&lt;p data-ke-size=&quot;size16&quot;&gt;문제 링크 : &lt;a href=&quot;https://www.acmicpc.net/problem/3682&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://www.acmicpc.net/problem/3682&lt;/a&gt;&lt;/p&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;문제 풀이&lt;/b&gt;&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;최소 간선을 추가해서 전체를 하나의 SCC로 만드는 문제이다.&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;먼저 주어진 그래프를 생각해보자. 애초에 문제에서 하나의 SCC 로 만드는 것이 목표이기 때문에 그래프를 SCC 간의 위상정렬로 놓고 생각하지 않을 이유가 없다. 따라서 그래프에서 먼저 SCC를 구하자. SCC 내에서는 서로 동치이기 때문에 추가적인 간선을 이을 필요가 없다. 따라서 처음에 구한 하나의 SCC 는 하나의 정점으로 대체하여 생각할 수 있다.&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;그렇게 변형된 그래프를 생각해보자. 그래프에는 사이클이 존재하지 않는다. 여기서 모든 정점을 묶어서 SCC로 만들어 주어야 한다. 이를 위해서는 모든 정점의 outdegree와 indegree가 1 이상이어야 한다. 즉, outdegree가 없는 정점들에서 나가는 간선이 하나씩 추가되어야 하고, indegree가 없는 정점들로 들어가는 간선이 하나씩은 존재해야 한다. outdegree가 없는 정점에서 indegree가 없는 다른 정점으로 이어주면 되기 때문에, 필요한 간선의 개수는 max(outdegree가 없는 정점의 수, indegree가 없는 정점의 수) 가 된다.&amp;nbsp;&lt;/p&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;코드&lt;/b&gt;&lt;/h3&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #f0f0f0; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #272727; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #4f4f4f;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #aaa; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;25&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;26&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;27&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;28&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;29&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;30&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;31&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;32&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;33&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;34&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;35&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;36&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;37&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;38&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;39&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;40&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;41&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;42&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;43&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;44&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;45&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;46&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;47&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;48&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;49&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;50&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;51&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;52&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;53&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;54&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;55&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;56&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;57&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;58&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;59&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;60&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;61&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;62&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;63&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;64&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;65&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;66&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;67&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;68&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;69&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;70&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;71&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;72&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;73&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;74&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;75&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;76&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;77&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;78&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;79&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;80&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;81&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;82&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;83&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;84&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;85&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;86&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;87&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;88&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;89&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;90&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;91&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;92&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;93&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;94&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;95&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;96&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;97&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;98&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;99&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;100&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;101&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;102&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;103&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;104&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;105&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;106&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;107&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;108&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;109&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;110&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;111&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;112&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;113&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;114&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;115&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;116&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;117&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;118&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;119&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;120&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;121&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;122&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;123&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;124&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;125&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;126&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;127&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;128&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #f0f0f0; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#include&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;bits&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;/&lt;/span&gt;stdc&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;.h&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;using&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;namespace&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;std&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;typedef&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;long&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;long&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;int&lt;/span&gt;&amp;nbsp;ll;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;typedef&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;double&lt;/span&gt;&amp;nbsp;dl;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;typedef&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;pair&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;dl,dl&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;pdi;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;typedef&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;pair&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;ll,ll&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;pii;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;typedef&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;pair&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;ll,pii&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;piii;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;ff&amp;nbsp;first&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;ss&amp;nbsp;second&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;eb&amp;nbsp;emplace_back&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;ep&amp;nbsp;emplace&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;pb&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;push_back&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;mp&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;make_pair&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;all(x)&amp;nbsp;(x).&lt;span style=&quot;color: #4be6fa;&quot;&gt;begin&lt;/span&gt;(),&amp;nbsp;(x).&lt;span style=&quot;color: #4be6fa;&quot;&gt;end&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;compress(v)&amp;nbsp;sort(all(v)),&amp;nbsp;v.erase(unique(all(v)),&amp;nbsp;v.&lt;span style=&quot;color: #4be6fa;&quot;&gt;end&lt;/span&gt;())&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;#define&lt;/span&gt;&amp;nbsp;IDX(v,&amp;nbsp;x)&amp;nbsp;lower_bound(all(v),&amp;nbsp;x)&amp;nbsp;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;-&lt;/span&gt;&amp;nbsp;v.&lt;span style=&quot;color: #4be6fa;&quot;&gt;begin&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;//cout&amp;lt;&amp;lt;fixed;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;//cout.precision(12);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;struct&lt;/span&gt;&amp;nbsp;poi{&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ll&amp;nbsp;val,xx,yy;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;};&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #4be6fa;&quot;&gt;vector&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;ll&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;x;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;ll&amp;nbsp;n,m;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;ll&amp;nbsp;mod&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;998244353&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #4be6fa;&quot;&gt;string&lt;/span&gt;&amp;nbsp;s;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #4be6fa;&quot;&gt;string&lt;/span&gt;&amp;nbsp;t;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;ll&amp;nbsp;arr[&lt;span style=&quot;color: #c10aff;&quot;&gt;101101&lt;/span&gt;];&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;ll&amp;nbsp;ind[&lt;span style=&quot;color: #c10aff;&quot;&gt;101101&lt;/span&gt;];&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;ll&amp;nbsp;oud[&lt;span style=&quot;color: #c10aff;&quot;&gt;101101&lt;/span&gt;];&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #4be6fa;&quot;&gt;vector&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;ll&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;v[&lt;span style=&quot;color: #c10aff;&quot;&gt;101101&lt;/span&gt;];&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #4be6fa;&quot;&gt;vector&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;ll&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;rev[&lt;span style=&quot;color: #c10aff;&quot;&gt;100101&lt;/span&gt;];&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #4be6fa;&quot;&gt;vector&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;ll&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;scc[&lt;span style=&quot;color: #c10aff;&quot;&gt;100101&lt;/span&gt;];&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;ll&amp;nbsp;vis[&lt;span style=&quot;color: #c10aff;&quot;&gt;1010101&lt;/span&gt;];&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #4be6fa;&quot;&gt;stack&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;ll&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;st;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #4be6fa;&quot;&gt;vector&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;ll&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;gv[&lt;span style=&quot;color: #c10aff;&quot;&gt;101101&lt;/span&gt;];&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;ll&amp;nbsp;gind[&lt;span style=&quot;color: #c10aff;&quot;&gt;100101&lt;/span&gt;];&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;ll&amp;nbsp;goud[&lt;span style=&quot;color: #c10aff;&quot;&gt;100101&lt;/span&gt;];&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;ll&amp;nbsp;num[&lt;span style=&quot;color: #c10aff;&quot;&gt;101101&lt;/span&gt;];&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;ll&amp;nbsp;gp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;void&lt;/span&gt;&amp;nbsp;dfs(ll&amp;nbsp;x){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;vis[x]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #ff3399;&quot;&gt;auto&lt;/span&gt;&amp;nbsp;k:v[x]){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;if&lt;/span&gt;(vis[k])&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;continue&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dfs(k);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;st.push(x);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;void&lt;/span&gt;&amp;nbsp;dfs2(ll&amp;nbsp;x){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;vis[x]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;num[x]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;gp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #ff3399;&quot;&gt;auto&lt;/span&gt;&amp;nbsp;k:rev[x]){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;if&lt;/span&gt;(vis[k])&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;continue&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dfs2(k);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #4be6fa;&quot;&gt;int&lt;/span&gt;&amp;nbsp;main(){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ios_base::sync_with_stdio(&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;cin&lt;/span&gt;.tie(&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ll&amp;nbsp;t;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;cin&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;t;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;while&lt;/span&gt;(t&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;-&lt;/span&gt;){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ll&amp;nbsp;i,j,k,a&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;,b&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;,c,d,e,f;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;cin&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;n&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;m;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;for&lt;/span&gt;(i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;n;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;v[i].clear();&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;rev[i].clear();&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ind[i]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;oud[i]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;gind[i]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;goud[i]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;gp&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;while&lt;/span&gt;(m&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;-&lt;/span&gt;){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;cin&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;a&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;gt;&lt;/span&gt;b;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;v[a].pb(b);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;rev[b].pb(a);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;for&lt;/span&gt;(i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;n;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;vis[i]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;for&lt;/span&gt;(i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;n;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;if&lt;/span&gt;(vis[i])&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;continue&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;vis[i]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dfs(i);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;for&lt;/span&gt;(i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;n;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;vis[i]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;while&lt;/span&gt;(st.&lt;span style=&quot;color: #4be6fa;&quot;&gt;size&lt;/span&gt;()){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ll&amp;nbsp;x&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;st.top();&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;st.&lt;span style=&quot;color: #4be6fa;&quot;&gt;pop&lt;/span&gt;();&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;if&lt;/span&gt;(vis[x])&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;continue&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;vis[x]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;gp&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dfs2(x);&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;for&lt;/span&gt;(i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;n;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #ff3399;&quot;&gt;auto&lt;/span&gt;&amp;nbsp;j:v[i]){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;if&lt;/span&gt;(num[i]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;num[j])&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;continue&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;gind[num[j]]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;goud[num[i]]&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ll&amp;nbsp;c1&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;,c2&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;if&lt;/span&gt;(gp&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;cout&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #ffd500;&quot;&gt;'\n'&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;continue&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;for&lt;/span&gt;(i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c10aff;&quot;&gt;1&lt;/span&gt;;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;=&lt;/span&gt;gp;i&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;){&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;if&lt;/span&gt;(&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;!&lt;/span&gt;gind[i])&amp;nbsp;c1&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #ff3399;&quot;&gt;if&lt;/span&gt;(&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;!&lt;/span&gt;goud[i])&amp;nbsp;c2&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;+&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #4be6fa;&quot;&gt;cout&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;max(c1,c2)&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #aaffaa;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff3399;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #ffd500;&quot;&gt;'\n'&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: right; margin-top: -13px; margin-right: 5px; font-size: 9px; font-style: italic;&quot;&gt;&lt;a style=&quot;color: #4f4f4ftext-decoration:none;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #4f4f4f; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;</description>
      <category>코딩/백준 문제 풀이</category>
      <category>BOJ</category>
      <author>stonejjun</author>
      <guid isPermaLink="true">https://stonejjun.tistory.com/210</guid>
      <comments>https://stonejjun.tistory.com/210#entry210comment</comments>
      <pubDate>Fri, 26 Aug 2022 16:56:25 +0900</pubDate>
    </item>
  </channel>
</rss>