<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>inamori</author_name>
  <author_url>https://blog.hatena.ne.jp/inamori/</author_url>
  <blog_title>inamori’s diary</blog_title>
  <blog_url>https://inamori.hateblo.jp/</blog_url>
  <categories>
  </categories>
  <description>https://atcoder.jp/contests/abc438/tasks/abc438_gこれも足し算の順番を変えて解きます。順番を変えるというのは、どこを固定するかという話です。ここではBを固定します。入力例1だとまずBの最初の1とそれに対応するAを考えます。Bのindex:i mod Mが0ときにAのindex:i mod Nは0, 2, 1となります。具体的には、3, 4, 1です。このときBは1でこれより小さいAはありません。なので、3*1 = 3となります。個々のBに対応するAで木を作って、Bより小さい値だけ和を取ります。そして、足りない個数ぶんだけBを足します。 次のBも同…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Finamori.hateblo.jp%2Fentry%2F2026%2F01%2F24%2F191700&quot; title=&quot;AtCoder Beginner Contest 438 G - inamori’s diary&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2026-01-24 19:17:00</published>
  <title>AtCoder Beginner Contest 438 G</title>
  <type>rich</type>
  <url>https://inamori.hateblo.jp/entry/2026/01/24/191700</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
